mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-04 06:06:19 +01:00
"update authorization header" fix (#514)
This commit is contained in:
@@ -567,7 +567,7 @@ class DiscordOAuthManager:
|
||||
|
||||
@staticmethod
|
||||
def __generate_role():
|
||||
custom_headers = {'accept':'application/json', 'authorization': 'Bot' + settings.DISCORD_BOT_TOKEN}
|
||||
custom_headers = {'accept':'application/json', 'authorization': 'Bot ' + settings.DISCORD_BOT_TOKEN}
|
||||
path = DISCORD_URL + "/guilds/" + str(settings.DISCORD_GUILD_ID) + "/roles"
|
||||
r = requests.post(path, headers=custom_headers)
|
||||
logger.debug("Received status code %s after generating new role." % r.status_code)
|
||||
@@ -597,7 +597,7 @@ class DiscordOAuthManager:
|
||||
|
||||
@staticmethod
|
||||
def update_groups(user_id, groups):
|
||||
custom_headers = {'content-type':'application/json', 'authorization': 'Bot' + settings.DISCORD_BOT_TOKEN}
|
||||
custom_headers = {'content-type':'application/json', 'authorization': 'Bot ' + settings.DISCORD_BOT_TOKEN}
|
||||
group_ids = [DiscordOAuthManager.__group_name_to_id(g) for g in groups]
|
||||
path = DISCORD_URL + "/guilds/" + str(settings.DISCORD_GUILD_ID) + "/members/" + str(user_id)
|
||||
data = {'roles': group_ids}
|
||||
|
||||
Reference in New Issue
Block a user