Skip to content

Commit

Permalink
Updates the order of Python imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jimchamp committed Dec 9, 2024
1 parent 4678c5b commit 12fca88
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion openlibrary/core/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Models of various OL objects.
"""

import json
import logging
from collections import defaultdict
from dataclasses import dataclass, field
Expand Down
11 changes: 5 additions & 6 deletions openlibrary/plugins/upstream/addtag.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,13 @@
from infogami.infobase.client import ClientException
from infogami.utils import delegate
from infogami.utils.view import add_flash_message, public

from openlibrary.accounts import get_current_user
from openlibrary.plugins.upstream import spamcheck
from openlibrary.plugins.upstream.addbook import safe_seeother, trim_doc
from openlibrary.plugins.upstream.models import Tag
from openlibrary.plugins.upstream.utils import render_template


SUBJECT_SUB_TYPES = ["subject", "person", "place", "time"]
TAG_TYPES = SUBJECT_SUB_TYPES + ["collection"]


@public
def get_tag_types():
return TAG_TYPES
Expand All @@ -30,6 +25,10 @@ def get_subject_tag_types():
return SUBJECT_SUB_TYPES


SUBJECT_SUB_TYPES = ["subject", "person", "place", "time"]
TAG_TYPES = SUBJECT_SUB_TYPES + ["collection"]


def validate_tag(tag):
return tag.get('name', '') and tag.get('tag_type', '') in get_tag_types()

Expand Down Expand Up @@ -227,7 +226,7 @@ def POST(self, tag_type):
"message.html", "Oops", 'Something went wrong. Please try again later.'
)
if not (patron := get_current_user()):
raise web.seeother(f'/account/login')
raise web.seeother('/account/login')
if not self.has_permission(patron):
raise web.unauthorized()

Expand Down
1 change: 0 additions & 1 deletion openlibrary/plugins/worksearch/subjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from infogami.plugins.api.code import jsonapi
from infogami.utils import delegate
from infogami.utils.view import render_template, safeint

from openlibrary.core.lending import add_availability
from openlibrary.core.models import Subject, Tag
from openlibrary.solr.query_utils import query_dict_to_str
Expand Down

0 comments on commit 12fca88

Please sign in to comment.