Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Findeton committed Nov 18, 2024
1 parent 2a9f223 commit 2bcb0ca
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions iam/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3382,6 +3382,25 @@ def post(request, pk=None):
status=400,
error_codename=ErrorCodes.BAD_REQUEST)

for election_id in election_ids:
permission_required(request.user, 'AuthEvent', ['edit', 'delete'], pk)

election_obj = AuthEvent.objects.get(pk=election_id)

action = Action(
executer=request.user,
receiver=None,
action_name="authevent:delete",
event=election_obj,
metadata=dict(
auth_event_id=election_obj.id,
auth_event_name=election_obj.name
)
)

action.save()
election_obj.delete()

data = {'status': 'ok'}
return json_response(data)

Expand Down

0 comments on commit 2bcb0ca

Please sign in to comment.