Skip to content

Commit

Permalink
fix: Super Admin should be able to delete spam events (#6767)
Browse files Browse the repository at this point in the history
  • Loading branch information
kushthedude authored and iamareebjamal committed Jan 22, 2020
1 parent 1c71c6d commit aa226d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/api/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ def before_update_object(self, event, data, view_kwargs):
validate_date(event, data)

if has_access('is_admin') and data.get('deleted_at') != event.deleted_at:
if len(event.orders) != 0:
if len(event.orders) != 0 and not has_access('is_super_admin'):
raise ForbiddenException({'source': ''}, "Event associated with orders cannot be deleted")
else:
event.deleted_at = data.get('deleted_at')
Expand Down

0 comments on commit aa226d4

Please sign in to comment.