fix missing filters
This commit is contained in:
parent
2cd3653def
commit
b3773d4ace
1 changed files with 9 additions and 0 deletions
|
@ -387,6 +387,15 @@ def get_ui(user_ui, user=None):
|
||||||
tids += add_edits(user.edits.exclude(status="featured"), 'personal')
|
tids += add_edits(user.edits.exclude(status="featured"), 'personal')
|
||||||
tids += add_edits(user.subscribed_edits.filter(status='public'), 'public')
|
tids += add_edits(user.subscribed_edits.filter(status='public'), 'public')
|
||||||
tids += add_edits(edit.models.Edit.objects.filter(status='featured'), 'featured')
|
tids += add_edits(edit.models.Edit.objects.filter(status='featured'), 'featured')
|
||||||
|
|
||||||
|
if 'filters' in ui:
|
||||||
|
filterids = [f['id'] for f in settings.CONFIG['itemKeys'] if f.get('filter')]
|
||||||
|
ui['filters'] = [f for f in ui['filters'] if f['id'] in filterids]
|
||||||
|
used = [f['id'] for f in ui['filters']]
|
||||||
|
unused = [f for f in settings.CONFIG['user']['ui']['filters'] if f['id'] not in used]
|
||||||
|
while len(ui['filters']) < len(settings.CONFIG['user']['ui']['filters']):
|
||||||
|
ui['filters'].append(unused.pop())
|
||||||
|
|
||||||
return ui
|
return ui
|
||||||
|
|
||||||
def init_user(user, request=None):
|
def init_user(user, request=None):
|
||||||
|
|
Loading…
Reference in a new issue