SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 19ee249f authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Remove redundant methods

parent 3ef0f968
No related branches found
No related tags found
No related merge requests found
...@@ -2,27 +2,16 @@ from .exceptions import JournalNameError, PaperNumberError ...@@ -2,27 +2,16 @@ from .exceptions import JournalNameError, PaperNumberError
def journal_name_abbrev_citation(journal_name): def journal_name_abbrev_citation(journal_name):
if journal_name == 'SciPost Physics': if journal_name == 'SciPostPhys':
return 'SciPost Phys.' return 'SciPost Phys.'
elif journal_name == 'SciPost Physics Select': elif journal_name == 'SciPostPhysSel':
return 'SciPost Phys. Sel.' return 'SciPost Phys. Sel.'
elif journal_name == 'SciPost Physics Lecture Notes': elif journal_name == 'SciPostPhysLectNotes':
return 'SciPost Phys. Lect. Notes' return 'SciPost Phys. Lect. Notes'
else: else:
raise JournalNameError(journal_name) raise JournalNameError(journal_name)
def journal_name_abbrev_doi(journal_name):
if journal_name == 'SciPost Physics':
return 'SciPostPhys'
elif journal_name == 'SciPost Physics Select':
return 'SciPostPhysSel'
elif journal_name == 'SciPost Physics Lecture Notes':
return 'SciPostPhysLectNotes'
else:
raise JournalNameError(journal_name)
def paper_nr_string(nr): def paper_nr_string(nr):
if nr < 10: if nr < 10:
return '00' + str(nr) return '00' + str(nr)
......
...@@ -6,7 +6,7 @@ from django.urls import reverse ...@@ -6,7 +6,7 @@ from django.urls import reverse
from .constants import SCIPOST_JOURNALS, SCIPOST_JOURNALS_DOMAINS,\ from .constants import SCIPOST_JOURNALS, SCIPOST_JOURNALS_DOMAINS,\
STATUS_DRAFT, STATUS_PUBLISHED, ISSUE_STATUSES STATUS_DRAFT, STATUS_PUBLISHED, ISSUE_STATUSES
from .helpers import paper_nr_string, journal_name_abbrev_doi, journal_name_abbrev_citation from .helpers import paper_nr_string, journal_name_abbrev_citation
from .managers import IssueManager, PublicationManager from .managers import IssueManager, PublicationManager
from scipost.constants import SCIPOST_DISCIPLINES, SCIPOST_SUBJECT_AREAS from scipost.constants import SCIPOST_DISCIPLINES, SCIPOST_SUBJECT_AREAS
...@@ -37,9 +37,6 @@ class Journal(models.Model): ...@@ -37,9 +37,6 @@ class Journal(models.Model):
def get_abbreviation_citation(self): def get_abbreviation_citation(self):
return journal_name_abbrev_citation(self.name) return journal_name_abbrev_citation(self.name)
def get_abbreviation_doi(self):
return journal_name_abbrev_doi(self.name)
class Volume(models.Model): class Volume(models.Model):
in_journal = models.ForeignKey(Journal, on_delete=models.CASCADE) in_journal = models.ForeignKey(Journal, on_delete=models.CASCADE)
...@@ -94,13 +91,6 @@ class Issue(models.Model): ...@@ -94,13 +91,6 @@ class Issue(models.Model):
return self.start_date <= timezone.now().date() and\ return self.start_date <= timezone.now().date() and\
self.until_date >= timezone.now().date() self.until_date >= timezone.now().date()
def period(self):
text = 'up to {{ until_month }} {{ year }}'
template = Template(text)
context = Context({'until_month': self.start_date.strftime('%B'),
'year': self.until_date.strftime('%Y')})
return template.render(context)
class Publication(models.Model): class Publication(models.Model):
accepted_submission = models.OneToOneField('submissions.Submission', on_delete=models.CASCADE) accepted_submission = models.OneToOneField('submissions.Submission', on_delete=models.CASCADE)
......
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