From 19ee249fa11afc5e0221069bc8631d3bf8d36ef0 Mon Sep 17 00:00:00 2001 From: Jorran de Wit <jorrandewit@outlook.com> Date: Fri, 7 Apr 2017 12:49:59 +0200 Subject: [PATCH] Remove redundant methods --- journals/helpers.py | 17 +++-------------- journals/models.py | 12 +----------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/journals/helpers.py b/journals/helpers.py index fb08cf89e..c31314def 100644 --- a/journals/helpers.py +++ b/journals/helpers.py @@ -2,27 +2,16 @@ from .exceptions import JournalNameError, PaperNumberError def journal_name_abbrev_citation(journal_name): - if journal_name == 'SciPost Physics': + if journal_name == 'SciPostPhys': return 'SciPost Phys.' - elif journal_name == 'SciPost Physics Select': + elif journal_name == 'SciPostPhysSel': return 'SciPost Phys. Sel.' - elif journal_name == 'SciPost Physics Lecture Notes': + elif journal_name == 'SciPostPhysLectNotes': return 'SciPost Phys. Lect. Notes' else: 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): if nr < 10: return '00' + str(nr) diff --git a/journals/models.py b/journals/models.py index 67c9d178f..28a3404ae 100644 --- a/journals/models.py +++ b/journals/models.py @@ -6,7 +6,7 @@ from django.urls import reverse from .constants import SCIPOST_JOURNALS, SCIPOST_JOURNALS_DOMAINS,\ 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 scipost.constants import SCIPOST_DISCIPLINES, SCIPOST_SUBJECT_AREAS @@ -37,9 +37,6 @@ class Journal(models.Model): def get_abbreviation_citation(self): return journal_name_abbrev_citation(self.name) - def get_abbreviation_doi(self): - return journal_name_abbrev_doi(self.name) - class Volume(models.Model): in_journal = models.ForeignKey(Journal, on_delete=models.CASCADE) @@ -94,13 +91,6 @@ class Issue(models.Model): return self.start_date <= timezone.now().date() and\ 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): accepted_submission = models.OneToOneField('submissions.Submission', on_delete=models.CASCADE) -- GitLab