Define superusers
This commit is contained in:
parent
fc18f93ff8
commit
c02380a1e4
@ -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
|
||||
|
6
lglog/secrets_example.py
Normal file
6
lglog/secrets_example.py
Normal file
@ -0,0 +1,6 @@
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user