Remember if finver form is extended
This commit is contained in:
@@ -1,26 +1,14 @@
|
||||
from sqlalchemy import event
|
||||
from flask import g
|
||||
import re
|
||||
|
||||
from atst.models.audit_event import AuditEvent
|
||||
from atst.utils import camel_to_snake, getattr_path
|
||||
|
||||
ACTION_CREATE = "create"
|
||||
ACTION_UPDATE = "update"
|
||||
ACTION_DELETE = "delete"
|
||||
|
||||
|
||||
def getattr_path(obj, path, default=None):
|
||||
_obj = obj
|
||||
for item in path.split("."):
|
||||
_obj = getattr(_obj, item, default)
|
||||
return _obj
|
||||
|
||||
|
||||
def camel_to_snake(camel_cased):
|
||||
s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", camel_cased)
|
||||
return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1).lower()
|
||||
|
||||
|
||||
class AuditableMixin(object):
|
||||
@staticmethod
|
||||
def create_audit_event(connection, resource, action):
|
||||
|
@@ -100,6 +100,7 @@ class Request(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
|
||||
"uii_ids",
|
||||
"treasury_code",
|
||||
"ba_code",
|
||||
"extended"
|
||||
]
|
||||
|
||||
@property
|
||||
@@ -135,7 +136,7 @@ class Request(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
|
||||
|
||||
@property
|
||||
def financial_verification(self):
|
||||
return self.body.get("financial_verification")
|
||||
return self.body.get("financial_verification", {})
|
||||
|
||||
@property
|
||||
def is_financially_verified(self):
|
||||
|
@@ -77,6 +77,7 @@ class RequestRevision(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
|
||||
uii_ids = Column(ARRAY(String))
|
||||
treasury_code = Column(String)
|
||||
ba_code = Column(String)
|
||||
extended = Column(Boolean, default=False)
|
||||
|
||||
def __repr__(self):
|
||||
return "<RequestRevision(request='{}', id='{}')>".format(
|
||||
|
Reference in New Issue
Block a user