Skip to content

Commit 6aa911a

Browse files
Fix HTTP 500 error handling during room deletion
1 parent d141086 commit 6aa911a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/eventyay/orga/views/schedule.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,11 +512,17 @@ def delete_handler(self, request, *args, **kwargs):
512512
obj = self.get_object()
513513
obj.deleted = True
514514
obj.save(update_fields=['deleted'])
515-
messages.success(request, phrases.base.success)
515+
messages.success(request, _('The selected room has been deleted.'))
516516
return redirect(self.get_success_url())
517517
except ProtectedError:
518518
messages.error(
519519
request,
520520
_('There is or was a session scheduled in this room. It cannot be deleted.'),
521521
)
522522
return self.delete_view(request, *args, **kwargs)
523+
except Exception as e:
524+
messages.error(
525+
request,
526+
_('An error occurred while deleting the room: {}').format(str(e)),
527+
)
528+
return self.delete_view(request, *args, **kwargs)

0 commit comments

Comments
 (0)