1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-25 16:22:22 +00:00

Fix extra token accesses when someone is already logged

This commit is contained in:
Yohann D'ANELLO 2020-05-30 20:47:54 +02:00
parent 1ef48fc3b4
commit dd4171b0e8

View File

@ -79,6 +79,7 @@ class ExtraAccessMiddleware(object):
if request.user.is_authenticated: if request.user.is_authenticated:
pool = Pool.objects.filter(extra_access_token=request.GET["extra_access_token"]) pool = Pool.objects.filter(extra_access_token=request.GET["extra_access_token"])
if pool.exists(): if pool.exists():
pool = pool.get()
pool.juries.add(request.user) pool.juries.add(request.user)
pool.save() pool.save()
else: else: