Skip to content

Commit

Permalink
Add rerunning validators
Browse files Browse the repository at this point in the history
  • Loading branch information
dladrichem committed Apr 9, 2024
1 parent e6201e6 commit 11511e7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions flood_adapt/dbs_classes/dbs_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ def copy(self, old_name: str, new_name: str, new_description: str):
copy_object.attrs.name = new_name
copy_object.attrs.description = new_description

# After changing the name and description, receate the model to re-trigger the validators
copy_object.attrs = type(copy_object.attrs)(**copy_object.attrs.dict())

# Then a save. Checking whether the name is already in use is done in the save function
self.save(copy_object)

Expand Down

0 comments on commit 11511e7

Please sign in to comment.