mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
One big bug slapping commit
Fix bug where arguments would not have default values and would break editing users (panel handler line 507, 508 and 559), fix major typo (panel handler line 569) and fix autobleach logging (base handler lines 35 and 36)
This commit is contained in:
parent
1e2abff40a
commit
805f51ffb2
@ -32,7 +32,8 @@ class BaseHandler(tornado.web.RequestHandler):
|
|||||||
def autobleach(self, name, text):
|
def autobleach(self, name, text):
|
||||||
for r in self.redactables:
|
for r in self.redactables:
|
||||||
if r in name:
|
if r in name:
|
||||||
logger.debug("Auto-bleaching {}: {}".format(name, "[**REDACTED* c,mmvkkkkkkkkkkkkkkkkkkkkkkkkn*]"))
|
logger.debug("Auto-bleaching {}: {}".format(name, "[**REDACTED**]"))
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
logger.debug("Auto-bleaching {}: {}".format(name, text))
|
logger.debug("Auto-bleaching {}: {}".format(name, text))
|
||||||
if type(text) in self.nobleach:
|
if type(text) in self.nobleach:
|
||||||
|
@ -504,8 +504,8 @@ class PanelHandler(BaseHandler):
|
|||||||
username = bleach.clean(self.get_argument('username', None))
|
username = bleach.clean(self.get_argument('username', None))
|
||||||
password0 = bleach.clean(self.get_argument('password0', None))
|
password0 = bleach.clean(self.get_argument('password0', None))
|
||||||
password1 = bleach.clean(self.get_argument('password1', None))
|
password1 = bleach.clean(self.get_argument('password1', None))
|
||||||
enabled = int(float(bleach.clean(self.get_argument('enabled'), '0')))
|
enabled = int(float(self.get_argument('enabled', '0')))
|
||||||
regen_api = int(float(bleach.clean(self.get_argument('regen_api', '0'))))
|
regen_api = int(float(self.get_argument('regen_api', '0')))
|
||||||
|
|
||||||
if not exec_user['superuser']:
|
if not exec_user['superuser']:
|
||||||
self.redirect("/panel/error?error=Unauthorized access: not superuser")
|
self.redirect("/panel/error?error=Unauthorized access: not superuser")
|
||||||
@ -556,7 +556,7 @@ class PanelHandler(BaseHandler):
|
|||||||
username = bleach.clean(self.get_argument('username', None))
|
username = bleach.clean(self.get_argument('username', None))
|
||||||
password0 = bleach.clean(self.get_argument('password0', None))
|
password0 = bleach.clean(self.get_argument('password0', None))
|
||||||
password1 = bleach.clean(self.get_argument('password1', None))
|
password1 = bleach.clean(self.get_argument('password1', None))
|
||||||
enabled = int(float(bleach.clean(self.get_argument('enabled'), '0')))
|
enabled = int(float(self.get_argument('enabled', '0')))
|
||||||
|
|
||||||
if not exec_user['superuser']:
|
if not exec_user['superuser']:
|
||||||
self.redirect("/panel/error?error=Unauthorized access: not superuser")
|
self.redirect("/panel/error?error=Unauthorized access: not superuser")
|
||||||
@ -566,7 +566,7 @@ class PanelHandler(BaseHandler):
|
|||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
# does this user id exist?
|
# does this user id exist?
|
||||||
if db_helper.get_userid_by_name(username) is not None:
|
if db_helper.get_user_id_by_name(username) is not None:
|
||||||
self.redirect("/panel/error?error=User exists")
|
self.redirect("/panel/error?error=User exists")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user