udf
This commit is contained in:
parent
3d7d70fd9b
commit
c26c87d25f
4
app.py
4
app.py
@ -292,16 +292,18 @@ def post_change_pwd():
|
|||||||
@post('/delete')
|
@post('/delete')
|
||||||
def post_delete():
|
def post_delete():
|
||||||
form = request.forms.getunicode
|
form = request.forms.getunicode
|
||||||
|
tools = Tools()
|
||||||
|
|
||||||
def error(msg):
|
def error(msg):
|
||||||
return delete_tpl(alerts=[('error', msg, 'fadeOut')], str=i18n.str)
|
return delete_tpl(alerts=[('error', msg, 'fadeOut')], str=i18n.str)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
username = newSession().get()['username']
|
username = newSession().get()['username']
|
||||||
if(form('username').lower() == username):
|
if(tools.input_validation(form('username')) and form('username').lower() == username):
|
||||||
del_user(username)
|
del_user(username)
|
||||||
else:
|
else:
|
||||||
return(error(i18n.msg[19]))
|
return(error(i18n.msg[19]))
|
||||||
|
|
||||||
except Error as e:
|
except Error as e:
|
||||||
LOG.warning("Unsuccessful attempt to delete the account: %s" % e)
|
LOG.warning("Unsuccessful attempt to delete the account: %s" % e)
|
||||||
return error(str(e))
|
return error(str(e))
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user