-
Notifications
You must be signed in to change notification settings - Fork 297
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
add support for datetime on final_shifts API parameters #3103
add support for datetime on final_shifts API parameters #3103
Conversation
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.
overall LGTM. Thanks for the contribution! Once you update those tests I'll go ahead and approve/merge
@@ -1095,7 +1102,7 @@ def test_oncall_shifts_export_truncate_events( | |||
|
|||
# request shifts on a Tu (ie. 00:00 - 09:00) | |||
url = reverse("api-public:schedules-final-shifts", kwargs={"pk": schedule.public_primary_key}) | |||
response = client.get(f"{url}?start_date=2023-01-03&end_date=2023-01-03", format="json", HTTP_AUTHORIZATION=token) | |||
response = client.get(f"{url}?start_date=2023-01-03T09:00&end_date=2023-01-03T09:00", format="json", HTTP_AUTHORIZATION=token) | |||
assert response.status_code == status.HTTP_200_OK | |||
|
|||
expected_on_call_times = {user1_public_primary_key: 9} |
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.
for these tests, do you mind parameterizing them to test both formats? 🙂
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.
I added separate tests for validating the parameter formats. Let me know if i missed the mark on what you were asking.
This change essentially means that specifying a date only will result in a report that starts and ends at 00:00 for the time.
@njohnstone2 also do you mind adding a small note about this to the changelog? thank you! |
@joeyorlando Is there any update on this PR? Just making sure you are not waiting on anything from me |
@njohnstone2 apologies, I was out for a bit. Merging this now. Thanks again for the contribution 🙌 |
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
What this PR does
DateField
toDateTimeField
on thefinal_shifts
API endpointstart_date
andend_date
parameters (e.g. 2021-01-01 or 2021-01-01T01:00)YYYY-MM-DD hh:mm
Which issue(s) this PR fixes
#3086
Checklist
pr:no public docs
PR label added if not required)CHANGELOG.md
updated (orpr:no changelog
PR label added if not required)