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
00e14b8b
"README.rst" did not exist on "e5b4aaf05e4ae16cbe2cab80e9f578bd37bcc70d"
Commit
00e14b8b
authored
1 year ago
by
George Katsikas
Browse files
Options
Downloads
Patches
Plain Diff
add minor static typing annotations and exceptions
parent
4dde6c4e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scipost_django/production/models.py
+12
-5
12 additions, 5 deletions
scipost_django/production/models.py
scipost_django/submissions/models/submission.py
+5
-2
5 additions, 2 deletions
scipost_django/submissions/models/submission.py
with
17 additions
and
7 deletions
scipost_django/production/models.py
+
12
−
5
View file @
00e14b8b
...
...
@@ -2,7 +2,7 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)"
__license__
=
"
AGPL v3
"
from
typing
import
List
from
typing
import
TYPE_CHECKING
from
django.db
import
models
from
django.contrib.contenttypes.fields
import
GenericRelation
from
django.urls
import
reverse
...
...
@@ -43,6 +43,9 @@ from .utils import proofs_id_to_slug
from
finances.models
import
WorkLog
from
scipost.storage
import
SecureFileStorage
if
TYPE_CHECKING
:
from
submissions.models
import
Submission
class
ProductionUser
(
models
.
Model
):
"""
...
...
@@ -68,7 +71,7 @@ class ProductionUser(models.Model):
class
ProductionStream
(
models
.
Model
):
submission
=
models
.
OneToOneField
(
submission
=
models
.
OneToOneField
[
"
Submission
"
]
(
"
submissions.Submission
"
,
on_delete
=
models
.
CASCADE
,
related_name
=
"
production_stream
"
,
...
...
@@ -297,7 +300,7 @@ class ProofsRepository(models.Model):
(
PROOFS_REPO_PRODUCTION_READY
,
"
The repository is ready for production
"
),
)
stream
=
models
.
OneToOneField
(
stream
=
models
.
OneToOneField
[
"
ProductionStream
"
]
(
ProductionStream
,
on_delete
=
models
.
CASCADE
,
related_name
=
"
proofs_repository
"
,
...
...
@@ -348,7 +351,11 @@ class ProofsRepository(models.Model):
a Selections paper, it is the flagship journal of the college.
"""
decision_journal
=
self
.
stream
.
submission
.
editorial_decision
.
for_journal
# Guard against null editorial decision
if
not
(
decision
:
=
self
.
stream
.
submission
.
editorial_decision
):
raise
ValueError
(
"
No (non-deprecated) editorial decision exists
"
)
decision_journal
=
decision
.
for_journal
if
"
Selections
"
in
decision_journal
.
name
:
paper_field
=
self
.
stream
.
submission
.
acad_field
...
...
@@ -410,7 +417,7 @@ class ProofsRepository(models.Model):
)
@cached_property
def
template_paths
(
self
)
->
L
ist
[
str
]:
def
template_paths
(
self
)
->
l
ist
[
str
]:
"""
Return the list of paths to the various templates used for the proofs.
"""
...
...
This diff is collapsed.
Click to expand it.
scipost_django/submissions/models/submission.py
+
5
−
2
View file @
00e14b8b
...
...
@@ -3,7 +3,7 @@ __license__ = "AGPL v3"
import
datetime
from
typing
import
List
from
typing
import
TYPE_CHECKING
import
feedparser
import
uuid
...
...
@@ -43,6 +43,9 @@ from ..exceptions import StageNotDefinedError
from
..managers
import
SubmissionQuerySet
,
SubmissionEventQuerySet
from
..refereeing_cycles
import
ShortCycle
,
DirectCycle
,
RegularCycle
if
TYPE_CHECKING
:
from
submissions.models
import
EditorialDecision
class
SubmissionAuthorProfile
(
models
.
Model
):
submission
=
models
.
ForeignKey
(
...
...
@@ -942,7 +945,7 @@ class Submission(models.Model):
return
list
(
set
(
fellows
))
@property
def
editorial_decision
(
self
):
def
editorial_decision
(
self
)
->
"
EditorialDecision | None
"
:
"""
Returns the latest EditorialDecision (if it exists).
"""
if
self
.
editorialdecision_set
.
nondeprecated
().
exists
():
return
self
.
editorialdecision_set
.
nondeprecated
().
latest_version
()
...
...
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