Skip to content

Commit

Permalink
Merge pull request #95 from borgia-app/hotfix/perm_sharedevent
Browse files Browse the repository at this point in the history
[Finances: Fix] Fix error on missing Permission
  • Loading branch information
rowsky authored Dec 7, 2018
2 parents 74df5f8 + edf5404 commit 0f464f2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions finances/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -953,12 +953,18 @@ def get_context_data(self, **kwargs):
se.number_participants = se.get_number_participants()
se.total_weights_registrants = se.get_total_weights_registrants()
se.total_weights_participants = se.get_total_weights_participants()
se.has_perm_manage = (self.request.user == se.manager or
Permission.objects.get(codename='manage_sharedevent') in self.group.permissions.all())
try:
se.has_perm_manage = (self.request.user == se.manager or
Permission.objects.get(codename='manage_sharedevent') in self.group.permissions.all())
except ObjectDoesNotExist:
se.has_perm_manage = False
context['shared_events'] = shared_events
# Permission SelfRegistration
if Permission.objects.get(codename='self_register_sharedevent') in self.group.permissions.all():
context['has_perm_self_register_sharedevent'] = True
try:
if Permission.objects.get(codename='self_register_sharedevent') in self.group.permissions.all():
context['has_perm_self_register_sharedevent'] = True
except ObjectDoesNotExist:
pass

return context

Expand Down

0 comments on commit 0f464f2

Please sign in to comment.