mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-05-10 15:31:32 +00:00
Update views.py
This commit is contained in:
parent
0cf11c6348
commit
71ef3aedd8
@ -158,8 +158,6 @@ class ActivityDeleteView(View):
|
||||
activity = Activity.objects.get(pk=pk)
|
||||
activity.delete()
|
||||
return JsonResponse({"message": "Activity deleted"})
|
||||
except ProtectedError as e:
|
||||
return JsonResponse({"error": "Cannot delete this activity because it is still referenced by guests."}, status=400)
|
||||
except Activity.DoesNotExist:
|
||||
return JsonResponse({"error": "Activity not found"}, status=404)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user