-
Notifications
You must be signed in to change notification settings - Fork 67
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
use timezone when recording date_published at preprint acceptance #4057
Conversation
Can one of the admins verify this patch? |
There was a problem hiding this 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.
src/repository/views.py
Outdated
@@ -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"))) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Dear Mr Jenkins: test this please |
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.