Skip to content
Snippets Groups Projects
Verified Commit ad3a5f45 authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Raise exception.

parent ea317c6a
No related branches found
No related tags found
1 merge request!100Resolve "Dashboard"
Pipeline #563 failed
from typing import Optional
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.http import Http404, HttpRequest, HttpResponse
from django.shortcuts import get_object_or_404, redirect, render
from django.utils.translation import ugettext_lazy as _
......@@ -264,6 +265,6 @@ def notification_mark_read(request: HttpRequest, id_: int) -> HttpResponse:
notification.read = True
notification.save()
else:
messages.danger(request, _("You are not allowed to mark notifications from other users as read."))
raise PermissionDenied(_("You are not allowed to mark notifications from other users as read!"))
return redirect("index")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment