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

Fix issues with LogViewSet JSON data handling and timestamp parsing #35

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

GonzaloMachado
Copy link

Fix issues with LogViewSet JSON data handling and timestamp parsing

Addressed problems encountered in LogViewSet related to JSON data handling and timestamp parsing with AM/PM format. This commit resolves the following issues:

  • Improved handling of request.body in LogViewSet's create method to prevent RawPostDataException by utilizing DRF's request (request.data) instead of direct access to request.body.
  • Enhanced timestamp parsing in Log.parse_log to correctly interpret timestamps containing AM/PM indicators (%p) using datetime.datetime.strptime.

Testing Scenario:

  • Tested LogViewSet endpoint functionality to ensure proper handling of incoming JSON data and accurate timestamp parsing.

Details:

  • Adjusted LogViewSet.create to align with Django and DRF conventions for handling request data.
  • Updated Log.parse_log to include %p in the format string for parsing timestamps accurately.

This commit addresses issue #34

@patroqueeet
Copy link
Collaborator

lgtm.

@NachE @alexandernst good to merge for you?

@NachE
Copy link
Member

NachE commented Jul 15, 2024

This PR looks good for me

@alexandernst alexandernst merged commit ea8fa55 into Develatio:develop Jul 15, 2024
3 checks passed
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.

None yet

4 participants