Example #1
0
 def first_five(self):
     return ','.join([user.get_full_name() for user in self.delegates.all()[:5] if can_admin_org(self, user)])
 def get_is_admin(self, obj):
     user = EmailUser.objects.get(id=self.context.get('user_id'))
     return can_admin_org(obj, user)
Example #3
0
 def get_is_admin(self, obj):
     user = self.context['request'].user
     # Check if the request user is among the first five delegates in the organisation
     return can_admin_org(obj, user)