Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use timezone when recording date_published at preprint acceptance #4057

Merged
merged 3 commits into from
Apr 22, 2024

Conversation

everreau
Copy link
Contributor

When a publication date was selected during preprint acceptance the default date was shown in local time but recorded as if it were in UTC. Add the timezone info to the datetime object created at acceptance.

@Bbkctp
Copy link
Contributor

Bbkctp commented Mar 26, 2024

Can one of the admins verify this patch?

@ajrbyers ajrbyers requested review from ajrbyers and mauromsl and removed request for ajrbyers April 5, 2024 08:37
@ajrbyers ajrbyers requested review from ajrbyers and removed request for mauromsl April 15, 2024 16:21
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.

Thanks @everreau, just a question added inline about the view.

@@ -879,9 +880,11 @@ def repository_manager_article(request, preprint_id):
'You must assign at least one galley file.',
)
else:
d = datetime.fromisoformat(request.POST.get('datetime', timezone.now().strftime("%Y-%m-%d %H:%M")))
Copy link
Member

Choose a reason for hiding this comment

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

What happens if a malformed date is passed in here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ajrbyers this scenario is unlikely because the form field does inline checking but I added a catch to handle this situation.

@mauromsl mauromsl assigned ajrbyers and unassigned everreau Apr 19, 2024
@mauromsl mauromsl requested review from mauromsl and ajrbyers April 19, 2024 08:10
@ajrbyers
Copy link
Member

Dear Mr Jenkins: test this please

@ajrbyers ajrbyers assigned mauromsl and unassigned ajrbyers Apr 19, 2024
@mauromsl mauromsl merged commit ac081f4 into openlibhums:master Apr 22, 2024
1 check failed
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.

4 participants