Skip to content

Commit 9dc1fc9

Browse files
committed
chore #3970 Clean up imports
1 parent f350126 commit 9dc1fc9

File tree

6 files changed

+18
-20
lines changed

6 files changed

+18
-20
lines changed

src/api/oai/views.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
A django implementation of the OAI-PMH interface
33
"""
44

5-
import warnings
6-
75
from django.utils import timezone
86
from django.views.generic.base import TemplateView
97

src/api/views.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import re
66
import warnings
77

8-
from django.apps import apps
98
from django.http import HttpResponse
109
from django.shortcuts import render
1110
from django.utils import timezone
@@ -82,11 +81,14 @@ class JournalViewSet(viewsets.ModelViewSet):
8281
http_method_names = ["get"]
8382

8483
def get_queryset(self):
85-
Journal = apps.get_model("journal.Journal")
8684
if self.request.journal:
87-
queryset = Journal.objects.filter(pk=self.request.journal.pk)
85+
queryset = journal_models.Journal.objects.filter(
86+
pk=self.request.journal.pk,
87+
)
8888
else:
89-
queryset = Journal.objects.filter(hide_from_press=False)
89+
queryset = journal_models.Journal.objects.filter(
90+
hide_from_press=False,
91+
)
9092
return queryset
9193

9294

@@ -99,11 +101,14 @@ class IssueViewSet(viewsets.ModelViewSet):
99101
http_method_names = ["get"]
100102

101103
def get_queryset(self):
102-
Issue = apps.get_model("journal.Issue")
103104
if self.request.journal:
104-
queryset = Issue.objects.filter(journal=self.request.journal)
105+
queryset = journal_models.Issue.objects.filter(
106+
journal=self.request.journal,
107+
)
105108
else:
106-
queryset = Issue.objects.filter(journal__hide_from_press=False)
109+
queryset = journal_models.Issue.objects.filter(
110+
journal__hide_from_press=False,
111+
)
107112

108113
return queryset
109114

src/comms/views.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import urllib
22

3-
from django.apps import apps
43
from django.shortcuts import render, get_object_or_404, redirect, Http404
54
from django.urls import reverse
65
from django.contrib import messages
@@ -10,6 +9,7 @@
109

1110
from comms import models, forms, logic
1211
from core import models as core_models
12+
from journal import models as journal_models
1313
from security.decorators import editor_user_required, file_user_required, has_request
1414
from utils.decorators import GET_language_override
1515
from utils.shared import language_override_redirect
@@ -212,10 +212,9 @@ def news_list(request, tag=None, presswide=False):
212212
all_tags = models.Tag.objects.all()
213213

214214
if presswide or request.model_content_type.model == "press":
215-
Journal = apps.get_model("journal.Journal")
216215
press_visible_journal_pks = [
217216
journal.pk
218-
for journal in Journal.objects.filter(
217+
for journal in journal_models.Journal.objects.filter(
219218
hide_from_press=False,
220219
)
221220
]

src/identifiers/logic.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import time
1212
import itertools
1313

14-
from django.apps import apps
1514
from django.urls import reverse
1615
from django.template.loader import render_to_string
1716
from django.utils.http import urlencode
@@ -28,7 +27,7 @@
2827
from utils import setting_handler, render_template
2928
from crossref.restful import Depositor
3029
from identifiers import models
31-
from submission import models as submission_models
30+
from journal import models as journal_models
3231

3332
logger = get_logger(__name__)
3433

@@ -51,8 +50,7 @@ def register_batch_of_crossref_dois(articles, **kwargs):
5150

5251
use_crossref, test_mode, missing_settings = check_crossref_settings(journal)
5352

54-
Journal = apps.get_model("journal.Journal")
55-
if journal.status == Journal.PublishingStatus.TEST:
53+
if journal.status == journal_models.Journal.PublishingStatus.TEST:
5654
test_mode = True
5755

5856
if use_crossref and not missing_settings:

src/themes/OLH/templates/press/press_journal_set.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{% load static %}
33

44
{% for journal in journals %}
5-
{% setting_var journal 'disable_journal_submission' as submission_disabled %}
65
<div class="large-12 columns border-right border-bottom journal-div">
76
<div class="box journal">
87
<div class="row collapse">
@@ -45,7 +44,7 @@ <h3>{% trans 'Disciplines' %}</h3>
4544
</div>
4645
<div class="expanded button-group">
4746
{% if journal.is_remote %}
48-
{% if not submission_disabled %}
47+
{% if not journal_settings.general.disable_journal_submission %}
4948
<a href="{{ journal.remote_submit_url }}"
5049
class="button"
5150
target="_blank"
@@ -62,7 +61,7 @@ <h3>{% trans 'Disciplines' %}</h3>
6261
{% include "elements/icons/link_external.html" %}
6362
</a>
6463
{% else %}
65-
{% if not submission_disabled %}
64+
{% if not journal_settings.general.disable_journal_submission %}
6665
<a href="{% journal_base_url journal %}{% url 'submission_start' %}"
6766
class="button"><span>{% trans 'Submit' %}</span></a>
6867
{% endif %}

src/utils/logic.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import hmac
44
from urllib.parse import SplitResult, urlencode, urlparse, unquote
55

6-
from django.apps import apps
76
from django.conf import settings
87
from django.contrib.contenttypes.models import ContentType
98
from django.http import QueryDict

0 commit comments

Comments
 (0)