Skip to content

Commit

Permalink
rien
Browse files Browse the repository at this point in the history
  • Loading branch information
joelclems committed Mar 10, 2021
1 parent 73dcc41 commit bc45d17
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/modules/oeasc/degat_foret/repository.py
Expand Up @@ -29,6 +29,7 @@ def create_or_modify(model, key, dict_in):
if val:
elem = DB.session.query(model).filter(getattr(model, key) == val).first()


if elem is None:
elem = model()
DB.session.add(elem)
Expand Down Expand Up @@ -163,15 +164,16 @@ def create_or_update_declaration(post_data):

post_data['foret'] = foret.as_dict(True)


declaration = create_or_modify(
TDeclaration,
'id_declaration',
post_data
)


patch_areas_declarations(declaration.id_declaration)


return declaration.as_dict(True)


Expand Down

0 comments on commit bc45d17

Please sign in to comment.