diff --git a/scipost_django/production/constants.py b/scipost_django/production/constants.py index 917a3b85248973c9f93d938fbdfc6c3294fa7025..556a5ee61c98eb993c3e853723ee7093a8420c99 100644 --- a/scipost_django/production/constants.py +++ b/scipost_django/production/constants.py @@ -74,16 +74,3 @@ PRODUCTION_ALL_WORK_LOG_TYPES = ( "Cited people have been notified/invited to SciPost", ), ) - -PROOFS_REPO_UNINITIALIZED = "uninitialized" -PROOFS_REPO_CREATED = "created" -PROOFS_REPO_TEMPLATE_ONLY = "template_only" -PROOFS_REPO_TEMPLATE_FORMATTED = "template_formatted" -PROOFS_REPO_PRODUCTION_READY = "production_ready" -PROOFS_REPO_STATUSES = ( - (PROOFS_REPO_UNINITIALIZED, "The repository does not exist"), - (PROOFS_REPO_CREATED, "The repository exists but is empty"), - (PROOFS_REPO_TEMPLATE_ONLY, "The repository contains the bare template"), - (PROOFS_REPO_TEMPLATE_FORMATTED, "The repository contains the automatically formatted template"), - (PROOFS_REPO_PRODUCTION_READY, "The repository is ready for production"), -) diff --git a/scipost_django/production/models.py b/scipost_django/production/models.py index adb36134677f9246520b1ae0ce586790caba602e..e168ea5a5b91bd1c412399caf30e4227097d2f4a 100644 --- a/scipost_django/production/models.py +++ b/scipost_django/production/models.py @@ -24,8 +24,6 @@ from .constants import ( PRODUCTION_STREAM_COMPLETED, PROOFS_STATUSES, PROOFS_UPLOADED, - PROOFS_REPO_STATUSES, - PROOFS_REPO_UNINITIALIZED, ) from .managers import ( ProductionStreamQuerySet, @@ -246,6 +244,22 @@ class ProofsRepository(models.Model): ProofsRepository is a GitLab repository of Proofs for a Submission. """ + PROOFS_REPO_UNINITIALIZED = "uninitialized" + PROOFS_REPO_CREATED = "created" + PROOFS_REPO_TEMPLATE_ONLY = "template_only" + PROOFS_REPO_TEMPLATE_FORMATTED = "template_formatted" + PROOFS_REPO_PRODUCTION_READY = "production_ready" + PROOFS_REPO_STATUSES = ( + (PROOFS_REPO_UNINITIALIZED, "The repository does not exist"), + (PROOFS_REPO_CREATED, "The repository exists but is empty"), + (PROOFS_REPO_TEMPLATE_ONLY, "The repository contains the bare template"), + ( + PROOFS_REPO_TEMPLATE_FORMATTED, + "The repository contains the automatically formatted template", + ), + (PROOFS_REPO_PRODUCTION_READY, "The repository is ready for production"), + ) + stream = models.OneToOneField( ProductionStream, on_delete=models.CASCADE, @@ -371,7 +385,7 @@ def production_stream_create_proofs_repo(sender, instance, created, **kwargs): if created: ProofsRepository.objects.create( stream=instance, - status=PROOFS_REPO_UNINITIALIZED, + status=ProofsRepository.PROOFS_REPO_UNINITIALIZED, )