Skip to content

use timezone when recording date_published at preprint acceptance#4057

Merged
mauromsl merged 3 commits into
openlibhums:masterfrom
everreau:3392-fix-accept-timezone
Apr 22, 2024
Merged

use timezone when recording date_published at preprint acceptance#4057
mauromsl merged 3 commits into
openlibhums:masterfrom
everreau:3392-fix-accept-timezone

Conversation

@everreau

Copy link
Copy Markdown
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

Bbkctp commented Mar 26, 2024

Copy link
Copy Markdown
Contributor

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

@ajrbyers ajrbyers left a comment

Copy link
Copy Markdown
Member

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.

Comment thread src/repository/views.py Outdated
'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
Copy Markdown
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
Copy Markdown
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 ajrbyers and mauromsl April 19, 2024 08:10
@ajrbyers

Copy link
Copy Markdown
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
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