SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SciPost
SciPost
Commits
f552e129
Commit
f552e129
authored
7 months ago
by
SwoopDoable
Browse files
Options
Downloads
Patches
Plain Diff
Automatically git-tag publications on publish
parent
450015da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scipost_django/journals/forms.py
+17
-0
17 additions, 0 deletions
scipost_django/journals/forms.py
scipost_django/journals/templates/journals/publication_publish_form.html
+1
-0
1 addition, 0 deletions
...journals/templates/journals/publication_publish_form.html
with
18 additions
and
0 deletions
scipost_django/journals/forms.py
+
17
−
0
View file @
f552e129
...
...
@@ -7,6 +7,7 @@ import os
import
random
import
re
import
string
import
gitlab
from
datetime
import
datetime
...
...
@@ -1093,12 +1094,28 @@ class PublicationPublishForm(RequestFormMixin, forms.ModelForm):
noted_by
=
self
.
request
.
user
.
production_user
,
)
prodevent
.
save
()
def
tag_publication
(
self
)
->
None
:
"""
Creates a tag in the git repository for the publication.
"""
gl
=
gitlab
.
Gitlab
(
"
https://git.scipost.org
"
,
private_token
=
settings
.
GITLAB_KEY
)
gl
.
auth
()
publication
:
Publication
=
self
.
instance
repo_url
:
str
=
publication
.
accepted_submission
.
production_stream
.
proofs_repository
.
git_url
[
24
:]
# skip gitlab prefix
project
=
gl
.
projects
.
get
(
repo_url
)
tag_name
=
publication
.
doi_label
+
"
_Published
"
if
tag_name
not
in
[
tag
.
name
for
tag
in
project
.
tags
.
list
()]:
project
.
tags
.
create
({
"
tag_name
"
:
tag_name
,
"
ref
"
:
"
main
"
})
else
:
print
(
f
"
Publication tag:
{
tag_name
}
already exists. Something went wrong.
"
)
def
save
(
self
,
commit
=
True
):
if
commit
:
self
.
move_pdf
()
self
.
update_submission
()
self
.
update_stream
()
self
.
tag_publication
()
# Email authors
JournalUtils
.
load
({
"
publication
"
:
self
.
instance
})
...
...
This diff is collapsed.
Click to expand it.
scipost_django/journals/templates/journals/publication_publish_form.html
+
1
−
0
View file @
f552e129
...
...
@@ -41,6 +41,7 @@
<li>
Update the Submission status
</li>
<li>
Update the Production Stream status
</li>
<li>
Send the authors a publication-email
</li>
<li>
Tag the git repository as published
</li>
</ul>
<em>
Reminder: you should deposit the Crossref immediately after publishing the paper
</em>
</div>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment