1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-02-23 18:21:18 +00:00

Compare commits

..

No commits in common. "13414ee0c50760d76c667ebf454258d6272331ef" and "69325bff9aa0751c563fb3fa632fdc661af5b243" have entirely different histories.

2 changed files with 2 additions and 7 deletions

View File

@ -5,7 +5,7 @@
"fields": {
"pos": 100,
"name": "Plateforme du TFJM²",
"pattern": "^https://tfjm.org(:8448)?/.*$",
"pattern": "^https://tfjm.org:8448/.*$",
"user_field": "matrix_username",
"restrict_users": false,
"proxy": true,

View File

@ -2,7 +2,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import User
from haystack.generic_views import SearchView
@ -31,11 +30,7 @@ class UserMixin(LoginRequiredMixin):
class UserRegistrationMixin(LoginRequiredMixin):
def dispatch(self, request, *args, **kwargs):
user = request.user
user_object = User.objects.get(registration__pk=kwargs["pk"])
if user.is_authenticated and not user.registration.is_admin and user.registration.pk != kwargs["pk"] and \
not (user.registration.is_volunteer and user_object.registration.team is not None
and user_object.registration.team.participation.tournament
in user.registration.organized_tournaments.all()):
if user.is_authenticated and not user.registration.is_admin and user.registration.pk != kwargs["pk"]:
self.handle_no_permission()
return super().dispatch(request, *args, **kwargs)