Skip to content

Commit

Permalink
Move comment
Browse files Browse the repository at this point in the history
  • Loading branch information
annaCPR committed Sep 12, 2024
1 parent 6284fb1 commit 5584474
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/repository/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,16 +405,16 @@ def create(db: Session, document: DocumentCreateDTO) -> str:
family_doc.physical_document_id = phys_doc.id

if not family_doc.import_id:
# Generate the import_id for the new document
org = family_repo.get_organisation(
db, cast(str, family_doc.family_import_id)
)
if org is None:
raise ValidationError(
f"Cannot find counter to generate id for {family_doc.family_import_id}"
)

org_name = cast(str, org.name)

# Generate the import_id for the new document
family_doc.import_id = cast(
Column, generate_import_id(db, CountedEntity.Document, org_name)
)
Expand Down
4 changes: 2 additions & 2 deletions app/repository/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,14 @@ def create(db: Session, event: EventCreateDTO) -> str:
family_import_id = new_family_event.family_import_id

if not new_family_event.import_id:
# Generate the import_id for the new event
org = family_repo.get_organisation(db, cast(str, family_import_id))
if org is None:
raise ValidationError(
f"Cannot find counter to generate id for {family_import_id}"
)

org_name = cast(str, org.name)

# Generate the import_id for the new event
new_family_event.import_id = cast(
Column, generate_import_id(db, CountedEntity.Event, org_name)
)
Expand Down

0 comments on commit 5584474

Please sign in to comment.