Merge branch 'develop' into 'master'

Add custom kaehmys to filter list

See merge request !77
This commit is contained in:
Jan Tuomi
2017-10-19 20:02:02 +03:00
+5 -1
View File
@@ -235,7 +235,11 @@ def kaehmy_list_view(request, *args, **kwargs):
applications = applications.order_by('-timestamp')
filter_options_preset = PresetKaehmyRole.objects.annotate(form_count=Count('forms')).filter(form_count__gt=0)
filter_options = [(r.id, r.name, r.form_count) for r in filter_options_preset]
filter_options_preset_list = [(r.id, r.name, r.form_count) for r in filter_options_preset]
filter_options_custom = CustomKaehmyRole.objects.annotate(form_count=Count('forms')).filter(form_count__gt=0)
filter_options_custom_list = [(r.id, r.name, r.form_count) for r in filter_options_custom]
filter_options = filter_options_preset_list + filter_options_custom_list
context = {
'applications': applications,