SciPost Code Repository

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

add signal to advance repos on creation

parent 34b2be69
No related branches found
No related tags found
1 merge request!43Polish up new production page
This commit is part of merge request !42. Comments created here will be created in the context of that merge request.
......@@ -351,7 +351,7 @@ class ProofsRepository(models.Model):
@receiver(post_save, sender=ProductionStream)
def production_stream_create_proofs_repo(sender, instance, created, **kwargs):
"""
If a ProductionStream instance is created, a Proofs Repository instance is created
When a ProductionStream instance is created, a ProofsRepository instance is created
and linked to it.
"""
if created:
......@@ -362,3 +362,20 @@ def production_stream_create_proofs_repo(sender, instance, created, **kwargs):
post_save.connect(production_stream_create_proofs_repo, sender=ProductionStream)
@receiver(post_save, sender=ProofsRepository)
def advance_repo_on_gitlab(sender, instance, created, **kwargs):
"""
When a ProofsRepository instance is created, run the advance_git_repos command on it.
"""
if created:
from django.core import management
management.call_command(
"advance_git_repos",
id=instance.stream.submission.preprint.identifier_w_vn_nr,
)
post_save.connect(advance_repo_on_gitlab, sender=ProofsRepository)
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