From efd046abd8a354193433169bb1b469a38d6bac1c Mon Sep 17 00:00:00 2001 From: hadleyking Date: Thu, 12 Oct 2023 14:47:50 -0400 Subject: [PATCH] Fixes for publishing with fixtures Changes to be committed: modified: api/model/prefix.py modified: api/scripts/utilities/DbUtils.py --- api/model/prefix.py | 4 +++- api/scripts/utilities/DbUtils.py | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/api/model/prefix.py b/api/model/prefix.py index 2a2713bb..496dc922 100644 --- a/api/model/prefix.py +++ b/api/model/prefix.py @@ -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) diff --git a/api/scripts/utilities/DbUtils.py b/api/scripts/utilities/DbUtils.py index 18eefb05..398e86e1 100755 --- a/api/scripts/utilities/DbUtils.py +++ b/api/scripts/utilities/DbUtils.py @@ -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",