fix post method

This commit is contained in:
yamanq 2018-04-16 20:54:58 -04:00
parent 0d03cd67d4
commit 3d4735949e

View File

@ -226,11 +226,10 @@ def updates():
def editors():
if request.method == "POST":
received = request.get_json()
doer = received['editor']
if Editor.query.filter_by(username=received[username].count()) == 0 and Editor.query.filter_by(username=doer['username'], password=doer['password']).count() == 1:
user = Editor(authority = received[authority],
username = received[username],
password = received[password])
if Editor.query.filter_by(username=received['username'].count()) == 0 and check_privelege(received['editor'], 0):
user = Editor(authority = received['authority'],
username = received['username'],
password = received['password'])
db.session.add(user)
db.session.commit()
return user