Skip to content

Conversation

joemull
Copy link
Member

@joemull joemull commented Sep 29, 2025

Closes #3970.
Fixes #4701.
Fixes #4418.
Fixes #4987.

For an explanation of decisions see the documentation.

Copy link
Member

@ajrbyers ajrbyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally this is great work. I've only done a code review here as I'd like @mauromsl to look over it and then have it come back to me.

There is one major issue I see with this PR. Could you share the reason you’re using apps.get_model throughout this PR? I can see one or two places where it makes sense and in others where it seems a direct import would be better and more consistent.

I've made some comments and suggestions throughout, if you have any queries let me know.

A django implementation of the OAI-PMH interface
"""

import warnings
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this imported to fix something else? It doesn't look like its used in the diff.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just cruft from making a change and then deleting it

all_tags = models.Tag.objects.all()

if presswide or request.model_content_type.model == "press":
Journal = apps.get_model("journal.Journal")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a circular import if you import journal.models in this module?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was being overly defensive due to journal models' tendency to create circular imports. Will change this and other instances where I can.

)
tag = get_object_or_404(models.Tag, text=unquoted_tag)

all_tags = (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this moved?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that it could be filtered by the journal. I realized that it wasn't being filtered, so it could potentially include junk tags from journals that are hidden from the press.

articles = articles.filter(journal=request.journal)
else:
articles = articles.filter(journal__hide_from_press=False)
Journal = apps.get_model("journal.Journal")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same questions as before, why are we using apps.get_model here?


use_crossref, test_mode, missing_settings = check_crossref_settings(journal)

Journal = apps.get_model("journal.Journal")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same questions as before.


<div class="col-lg-8 col-md-10 journal-container">
{% for journal in journals %}
{% setting_var journal 'disable_journal_submission' as submission_disabled %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already in the context {{ journal_settings.general.disable_journal_submission }}. No need to fetch it again.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks--I was just moving this into a new file, but I will make the change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to have anything to do with this PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going through the utils/importers files with a fine-toothed comb to look for instances of journal-related querysets, to see if I needed to make changes related to hide_from_press or the test publishing status. As I was doing so, I remembered that we agreed these were deprecated during the ROR work. I'm not misremembering, am I? So that I didn't have to re-check them in a future piece of work on something else, I marked them deprecated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to have anything to do with this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to have anything to do with this PR.

import hmac
from urllib.parse import SplitResult, urlencode, urlparse, unquote

from django.apps import apps
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is imported and not used.

@ajrbyers ajrbyers assigned joemull and unassigned ajrbyers Sep 30, 2025
@joemull joemull assigned ajrbyers and unassigned joemull Sep 30, 2025
@joemull
Copy link
Member Author

joemull commented Sep 30, 2025

I've made some comments and suggestions throughout, if you have any queries let me know.

Thanks Andy--I've made some changes and added some replies above.

@joemull joemull requested a review from ajrbyers October 2, 2025 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants