SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 74254455 authored by George Katsikas's avatar George Katsikas :goat:
Browse files

move proofs repo constants inside model

parent a0043ae6
No related branches found
No related tags found
1 merge request!42Add git integration to server
This commit is part of merge request !42. Comments created here will be created in the context of that merge request.
......@@ -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"),
)
......@@ -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,
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment