Fixes in plugins and corefields
This commit is contained in:
parent
7838cc48ae
commit
6cf2b0eb85
3 changed files with 14 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ from paramecio.citoplasma.httputils import GetPostFiles
|
|||
from paramecio.citoplasma.keyutils import create_key_encrypt, create_key_encrypt_256, create_key
|
||||
from bottle import response,request
|
||||
from paramecio.cromosoma.webmodel import WebModel
|
||||
from time import time
|
||||
|
||||
try:
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ class LoginPlugin(object):
|
|||
|
||||
name = 'login'
|
||||
api = 2
|
||||
login_url='login'
|
||||
|
||||
def __init__(self, keyword='login'):
|
||||
|
||||
|
|
@ -51,11 +52,20 @@ class LoginPlugin(object):
|
|||
#Check if remember_login cookie
|
||||
#, secret=config.key_encrypt
|
||||
|
||||
redirect(make_url('login'))
|
||||
redirect(make_url(login_url))
|
||||
|
||||
# Replace the route callback with the wrapped one.
|
||||
return wrapper
|
||||
|
||||
class AdminLoginPlugin(LoginPlugin):
|
||||
|
||||
name = 'adminlogin'
|
||||
api = 2
|
||||
|
||||
def __init__(self, keyword='login_admin'):
|
||||
|
||||
self.keyword=keyword
|
||||
|
||||
|
||||
class DbPlugin(object):
|
||||
|
||||
|
|
|
|||
|
|
@ -179,6 +179,8 @@ class ForeignKeyField(IntegerField):
|
|||
|
||||
self.change_form(coreforms.SelectModelForm, [related_table, self.named_field, self.identifier_field])
|
||||
|
||||
self.default_value=None
|
||||
|
||||
def check(self, value):
|
||||
|
||||
value=super().check(value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue