alfortville: limit roles displayed in copies popup

This commit is contained in:
Frédéric Péters 2016-02-24 17:22:41 +01:00
parent e78bbf2fdd
commit 21252d1e20
1 changed files with 7 additions and 0 deletions

View File

@ -99,6 +99,13 @@ class Copies(DetailView):
context['checked_avis'] = checked_dicts[Inbox.AVIS]
context['checked_mandatory_avis'] = checked_dicts[Inbox.MANDATORY_AVIS]
context['roles'] = get_wcs_data('api/roles').get('data')
context['roles'] = [x for x in context['roles'] if
x['text'].startswith('Elu') or
x['text'].startswith('Cabinet') or
x['text'].startswith('Direction') or
x['text'].startswith('DGA') or
x['text'].startswith('DGS')]
context['roles'].sort(lambda x, y: cmp(x['text'], y['text']))
return context
def post(self, request, *args, **kwargs):