Superusers are also staff

This commit is contained in:
Yohann D'ANELLO 2020-11-16 04:07:19 +01:00
parent c02380a1e4
commit 50249f2ba2

View File

@ -70,7 +70,7 @@ class OAuthMiddleware(MiddlewareMixin):
user.discriminator = user_json['discriminator'] user.discriminator = user_json['discriminator']
user.email = user_json['email'] user.email = user_json['email']
user.avatar_id = user_json['avatar'] user.avatar_id = user_json['avatar']
user.is_superuser = f"{user.username}#{user.discriminator}" in settings.SUPERUSERS user.is_staff = user.is_superuser = f"{user.username}#{user.discriminator}" in settings.SUPERUSERS
user.save() user.save()
request.session['user'] = user.discord_id request.session['user'] = user.discord_id
return user return user