mirror of
https://github.com/wekan/wekan.git
synced 2025-04-20 12:07:11 -04:00
Added newuser to api.py .
Thanks to WassimDhib and xet7 ! Fixes #4774, fixes #4771
This commit is contained in:
parent
1165b21b1b
commit
f485ccea2f
1 changed files with 16 additions and 0 deletions
16
api.py
16
api.py
|
@ -40,6 +40,7 @@ if arguments == 0:
|
|||
print(" python3 api.py addcard AUTHORID BOARDID SWIMLANEID LISTID CARDTITLE CARDDESCRIPTION")
|
||||
print(" python3 api.py editcard BOARDID LISTID CARDID NEWCARDTITLE NEWCARDDESCRIPTION")
|
||||
print(" python3 api.py listattachments BOARDID # List attachments")
|
||||
print(" python3 api.py newuser USERNAME EMAIL PASSWORD")
|
||||
# TODO:
|
||||
# print(" python3 api.py attachmentjson BOARDID ATTACHMENTID # One attachment as JSON base64")
|
||||
# print(" python3 api.py attachmentbinary BOARDID ATTACHMENTID # One attachment as binary file")
|
||||
|
@ -231,6 +232,21 @@ if arguments == 6:
|
|||
print(data2)
|
||||
# ------- EDIT CARD END -----------
|
||||
|
||||
if arguments == 4:
|
||||
|
||||
if sys.argv[1] == 'newuser':
|
||||
|
||||
# ------- CREATE NEW USER START -----------
|
||||
username = sys.argv[2]
|
||||
email = sys.argv[3]
|
||||
password = sys.argv[4]
|
||||
headers = {'Accept': 'application/json', 'Authorization': 'Bearer {}'.format(apikey)}
|
||||
post_data = {'username': '{}'.format(username),'email': '{}'.format(email),'password': '{}'.format(password)}
|
||||
body = requests.post(users, data=post_data, headers=headers)
|
||||
print("=== CREATE NEW USER ===\n")
|
||||
print(body.text)
|
||||
# ------- CREATE NEW USER END -----------
|
||||
|
||||
if arguments == 3:
|
||||
|
||||
if sys.argv[1] == 'createlist':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue