Little bug fixes
This commit is contained in:
parent
2717829de4
commit
6f9931edca
5 changed files with 10 additions and 10 deletions
|
|
@ -85,7 +85,7 @@ class GenerateAdminClass:
|
|||
|
||||
GetPostFiles.obtain_post()
|
||||
|
||||
post=GetPostFiles.post
|
||||
#post=GetPostFiles.post
|
||||
|
||||
self.model.reset_conditions()
|
||||
|
||||
|
|
@ -107,12 +107,12 @@ class GenerateAdminClass:
|
|||
title_edit=I18n.lang('common', 'edit_new_item', 'Edit item')
|
||||
self.model.conditions=['WHERE `'+self.model.name+'`.`'+self.model.name_field_id+'`=%s', [GetPostFiles.get['id']]]
|
||||
|
||||
if insert_row(post):
|
||||
if insert_row(GetPostFiles.post):
|
||||
set_flash_message(I18n.lang('common', 'task_successful', 'Task successful'))
|
||||
redirect(self.url)
|
||||
else:
|
||||
|
||||
form=show_form(post, edit_forms, self.t, True)
|
||||
form=show_form(GetPostFiles.post, edit_forms, self.t, True)
|
||||
return self.t.load_template(self.template_insert, admin=self, title_edit=title_edit, form=form, model=self.model, id=GetPostFiles.get['id'])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class GetPostFiles:
|
|||
for post in required_post:
|
||||
|
||||
GetPostFiles.post[post]=GetPostFiles.post.get(post, '')
|
||||
|
||||
|
||||
s=get_session()
|
||||
|
||||
if 'csrf_token' in s:
|
||||
|
|
|
|||
|
|
@ -85,8 +85,8 @@ class UserModel(WebModel):
|
|||
|
||||
if self.updated:
|
||||
# Need the id
|
||||
GetPostFiles.obtain_get()
|
||||
GetPostFiles.obtain_post()
|
||||
#GetPostFiles.obtain_get()
|
||||
#GetPostFiles.obtain_post()
|
||||
|
||||
get_id=GetPostFiles.get.get(self.name_field_id, '0')
|
||||
|
||||
|
|
|
|||
|
|
@ -834,7 +834,9 @@ class WebModel:
|
|||
for type_error in self.errors.values():
|
||||
for error in type_error:
|
||||
error_txt+=error+"\n"
|
||||
|
||||
|
||||
error_txt=self.query_error+"\n"
|
||||
|
||||
return error_txt
|
||||
|
||||
@staticmethod
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ def admin(t):
|
|||
|
||||
user_admin.create_forms(['username', 'password', 'email', 'privileges', 'lang'])
|
||||
|
||||
user_admin.forms['privileges'].arr_select={0: I18n.lang('admin', 'without_privileges', 'Without privileges'), 1: I18n.lang('admin', 'selected_privileges', 'Selected privileges'), 2: I18n.lang('admin', 'administrator', 'Administrator')}
|
||||
user_admin.forms['privileges'].arr_select={'0': I18n.lang('admin', 'without_privileges', 'Without privileges'), '1': I18n.lang('admin', 'selected_privileges', 'Selected privileges'), '2': I18n.lang('admin', 'administrator', 'Administrator')}
|
||||
|
||||
user_admin.fields['password'].protected=False
|
||||
|
||||
|
|
@ -33,6 +33,4 @@ def admin(t):
|
|||
|
||||
form_admin=admin.show()
|
||||
|
||||
print(user_admin.show_errors())
|
||||
|
||||
return form_admin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue