Skip to content

Commit

Permalink
Fixes for publishing with fixtures
Browse files Browse the repository at this point in the history
Changes to be committed:
	modified:   api/model/prefix.py
	modified:   api/scripts/utilities/DbUtils.py
  • Loading branch information
HadleyKing committed Oct 17, 2023
1 parent d6eb1d5 commit efd046a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion api/model/prefix.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,9 @@ def create_counter_for_prefix(sender, instance=None, created=False, **kwargs):
instance: api.model.prefix.Prefix
created: bool
"""
if not 'test' in sys.argv:
if 'test' in sys.argv or 'loaddata' in sys.argv or 'flush' in sys.argv:
return
else:
if created:
prefix_table.objects.create(n_objects=1, prefix=instance.prefix)

Expand Down
5 changes: 4 additions & 1 deletion api/scripts/utilities/DbUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,10 @@ def messages(self, parameters, p_content=False):
"status_code": "409",
"message": "The provided object "
+ parameters["object_id"]
+ " has already been created on this server.",
+ " has already been created on this server."
+ " If you wish to publish a new version of this BCO try"
+ " to save the DRAFT with a different version number, and"
+ " then resubmit.",
},
"409_draft_object_id_conflict": {
"request_status": "FAILURE",
Expand Down

0 comments on commit efd046a

Please sign in to comment.