mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 14:13:21 +00:00
core: fix error 500 when accessing user tools with anonymous user
This commit is contained in:
parent
a2b431b1ab
commit
b18746e769
@ -770,6 +770,11 @@ class UserToolsView(QuickNotifMixin, UserTabsMixin, TemplateView):
|
||||
template_name = "core/user_tools.jinja"
|
||||
current_tab = "tools"
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
if request.user.is_anonymous:
|
||||
raise PermissionDenied
|
||||
return super(UserToolsView, self).dispatch(request, *args, **kwargs)
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
self.object = self.request.user
|
||||
from launderette.models import Launderette
|
||||
|
Loading…
Reference in New Issue
Block a user