Commit c02380a1 authored by ynerant's avatar ynerant
Browse files

Define superusers

parent fc18f93f
Pipeline #4766 failed with stages
in 1 minute and 8 seconds
......@@ -70,6 +70,7 @@ class OAuthMiddleware(MiddlewareMixin):
user.discriminator = user_json['discriminator']
user.email = user_json['email']
user.avatar_id = user_json['avatar']
user.is_superuser = f"{user.username}#{user.discriminator}" in settings.SUPERUSERS
user.save()
request.session['user'] = user.discord_id
return user
......
OAUTH_CLIENT_ID = 'CHANGE_ME'
OAUTH_CLIENT_SECRET = 'CHANGE_ME'
SUPERUSERS = [
'ÿnérant#0719',
]
......@@ -12,7 +12,7 @@ https://docs.djangoproject.com/en/3.1/ref/settings/
from pathlib import Path
from .secrets import OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET
from .secrets import OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET, SUPERUSERS
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
......@@ -162,3 +162,5 @@ OAUTH_CLIENT = {
},
'userinfo_endpoint': 'users/@me',
}
SUPERUSERS = SUPERUSERS
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment