Skip to content

Commit efd046a

Browse files
committed
Fixes for publishing with fixtures
Changes to be committed: modified: api/model/prefix.py modified: api/scripts/utilities/DbUtils.py
1 parent d6eb1d5 commit efd046a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

api/model/prefix.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,9 @@ def create_counter_for_prefix(sender, instance=None, created=False, **kwargs):
723723
instance: api.model.prefix.Prefix
724724
created: bool
725725
"""
726-
if not 'test' in sys.argv:
726+
if 'test' in sys.argv or 'loaddata' in sys.argv or 'flush' in sys.argv:
727+
return
728+
else:
727729
if created:
728730
prefix_table.objects.create(n_objects=1, prefix=instance.prefix)
729731

api/scripts/utilities/DbUtils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,10 @@ def messages(self, parameters, p_content=False):
731731
"status_code": "409",
732732
"message": "The provided object "
733733
+ parameters["object_id"]
734-
+ " has already been created on this server.",
734+
+ " has already been created on this server."
735+
+ " If you wish to publish a new version of this BCO try"
736+
+ " to save the DRAFT with a different version number, and"
737+
+ " then resubmit.",
735738
},
736739
"409_draft_object_id_conflict": {
737740
"request_status": "FAILURE",

0 commit comments

Comments
 (0)