Skip to content

Commit

Permalink
security update and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
tko22 committed Jun 13, 2019
1 parent c4e65a6 commit 88b9077
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions api/models/model_class_possibilities/Model_id_recursion.py
Expand Up @@ -7,11 +7,11 @@ class ModelSQL(object):
query_class = None # flask_alchemy attribute
query = None # flask_alchemy attribute

DONOTSEND_MODEL = {'_sa_instance_state'}
DONOTSEND_MODEL = {"_sa_instance_state"}
DONOTSEND = []

def __repr__(self) -> str:
return '<{}>'.format(self.__class__.__name__)
return "<{}>".format(self.__class__.__name__)

def to_dict_recursive(self) -> dict:
return self._to_dict_recursive(obj_ids_crossed=[id(self)])
Expand All @@ -26,6 +26,7 @@ def _to_dict_recursive(self, obj_ids_crossed: List[int]) -> dict:
check_crossed_obj -- Check if object has already been passed through
type_shunt_recursive -- Select actions for each type of attr
"""

def check_crossed_obj(obj: Type[ModelSQL]) -> any:
if id(obj) in obj_ids_crossed:
return str(obj)
Expand Down Expand Up @@ -58,4 +59,5 @@ def type_shunt_recursive(attribute: Any) -> Any:
attr = getattr(self, key)
result[key] = type_shunt_recursive(attr)


return result
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -7,5 +7,5 @@ flask>=1.0.2
gunicorn>=19.7.1
psycopg2==2.7.5
sqlalchemy-utils==0.33.6
sqlalchemy==1.1.14
sqlalchemy>=1.3.0
testing.postgresql==1.3.0

0 comments on commit 88b9077

Please sign in to comment.