Skip to content

Updates version detail to use the correct backend download url route#4670

Merged
mauromsl merged 1 commit into
masterfrom
b-4660-bugfix
Mar 25, 2025
Merged

Updates version detail to use the correct backend download url route#4670
mauromsl merged 1 commit into
masterfrom
b-4660-bugfix

Conversation

@ajrbyers

Copy link
Copy Markdown
Member

Closes #4660

@ajrbyers ajrbyers requested a review from mauromsl March 20, 2025 13:47
@ajrbyers ajrbyers added this to the v1.8.0 Tracker milestone Mar 20, 2025
@mauromsl mauromsl requested a review from alainna March 21, 2025 09:16
@mauromsl

Copy link
Copy Markdown
Member

@alainna I see @bibliotechy has added this to a branch on your fork, can you give us a green tick if you are happy with this solution for #4660

@mauromsl mauromsl assigned alainna and unassigned mauromsl Mar 21, 2025
@bibliotechy

Copy link
Copy Markdown
Contributor

@mauromsl It fixes the immediate problem, but when @alainna approved the new version, it gave a new error

Reverse for 'repository_preprint' with arguments '('',)' not found. 1 pattern(s) tried: ['repository/view/(?P<preprint_id>\\d+)/$']

That same issue does not happen on 1.7.4 without this commit merged in.

@ajrbyers

Copy link
Copy Markdown
Member Author

@mauromsl It fixes the immediate problem, but when @alainna approved the new version, it gave a new error

Reverse for 'repository_preprint' with arguments '('',)' not found. 1 pattern(s) tried: ['repository/view/(?P<preprint_id>\\d+)/$']

That same issue does not happen on 1.7.4 without this commit merged in.

Can you let me know the url path where this occurs?

@bibliotechy

Copy link
Copy Markdown
Contributor

@ajrbyers /repository/manager/versions/

@ajrbyers

Copy link
Copy Markdown
Member Author

Very odd indeed but I’ll try to patch it on Tuesday unless you can work it out.

@bibliotechy

Copy link
Copy Markdown
Contributor

On the POST to /repository/manager/versions/, it is trying to render this template

"<p><strong>Dear {{ pending_update.preprint.owner.full_name }},</strong></p>\n<p>Thank you for uploading a new version of {{ pending_update.preprint.title }}. This has been approved and is now live: {% if preprint.preprint_doi %} https://doi.org/{{ preprint.preprint_doi }} {% else %} {% site_url 'repository_preprint' preprint.pk %} (Note: A DOI has not yet been minted for this article. Please check your article URL in one hour for the DOI. If no DOI is available after 24 hours, please notify the {{ request.repository.name }} Team. {% endif %} </p>\n<p>{{ request.repository.name }} Team<br>{{ request.repository.site_url }}</p>"

but failing on the site_url template tag https://github.com/openlibhums/janeway/blob/v1.7.4/src/core/templatetags/fqdn.py#L33-L44

@ajrbyers

Copy link
Copy Markdown
Member Author

I think this might be a problem on your template. When passing the preprint id to repository_preprint it should use pending_update.preprint.pk rather than preprint.pk as preprint isn’t a variable that is available.

@alainna

alainna commented Mar 21, 2025

Copy link
Copy Markdown
Contributor

@ajrbyers @bibliotechy thanks for the tip! Confirmed: updated the dev "accept/reject version" email templates to match stg and no longer received the error

@ajrbyers

Copy link
Copy Markdown
Member Author

@mauromsl happy with this?

@mauromsl mauromsl merged commit b7f4994 into master Mar 25, 2025
@mauromsl mauromsl deleted the b-4660-bugfix branch March 25, 2025 09: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

Development

Successfully merging this pull request may close these issues.

Repository: PDF cannot be viewed/downloaded when moderating pending versions

4 participants