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 AnonymousUser post on status #9261

Merged
merged 2 commits into from
Jul 19, 2021
Merged

Fix AnonymousUser post on status #9261

merged 2 commits into from
Jul 19, 2021

Conversation

octavioamu
Copy link
Contributor

Description
  • Fix messages feedback
  • Fix errors
  • Fix blocking POST action on JS
  • Fix validation on server to not raise 500.
Refers/Fixes

fix https://gitcoin.atlassian.net/browse/GITC-166

Testing

app/retail/views.py Outdated Show resolved Hide resolved
response['status'] = 401
response['message'] = 'Not logged in!'
print('here', response)
return JsonResponse(status=response['status'], data={'status': 401,'message':response['message']})
Copy link
Member

@thelostone-mc thelostone-mc Jul 6, 2021

Choose a reason for hiding this comment

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

can we just do return JsonResponse(response, status=401) ?

Copy link
Contributor Author

@octavioamu octavioamu Jul 14, 2021

Choose a reason for hiding this comment

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

how it works is status 401 http status and data.status json pattern, not sure I get your feedback, could be like:
return JsonResponse(status=401, data={'status': 401,'message':response['message']})

Copy link
Member

Choose a reason for hiding this comment

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

Yes that cleaner

Copy link
Contributor

@zlsgh zlsgh left a comment

Choose a reason for hiding this comment

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

Remove print statement :-)

@thelostone-mc thelostone-mc marked this pull request as draft July 14, 2021 22:41
@octavioamu octavioamu marked this pull request as ready for review July 19, 2021 13:28
@gdixon gdixon merged commit fe23823 into stable Jul 19, 2021
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.

5 participants