fixed /setadmin function
This commit is contained in:
@@ -9,6 +9,7 @@ __license__ = "None"
|
||||
#side-dependencies: none
|
||||
#Work in Progress
|
||||
|
||||
from email import header
|
||||
import sys
|
||||
import os
|
||||
import requests as r
|
||||
@@ -340,14 +341,14 @@ class API_Handler:
|
||||
|
||||
Args:
|
||||
email (string): email of the user
|
||||
is_admin (String): "true" if user should be Admin, "false" if not
|
||||
is_admin (bool): "true" if user should be Admin, "false" if not
|
||||
|
||||
Returns:
|
||||
int: status code
|
||||
"""
|
||||
with r.Session() as s:
|
||||
headers = {'Authorization': 'Bearer ' + self.token} # only bot token is needed, user is chosen by email
|
||||
req = s.put(self.db_adress + "/user/setAdmin", json={"admin": str(is_admin),"email": str(email)})
|
||||
req = s.put(self.db_adress + "/user/setAdmin", json={"admin": is_admin,"email": str(email)}, headers=headers)
|
||||
return req.status_code
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user