anexia-it / django-rest-passwordreset

An extension of django rest framework, providing a configurable password reset strategy
BSD 3-Clause "New" or "Revised" License
419 stars 148 forks source link

Configurable response messages #65

Open surajraktate opened 5 years ago

surajraktate commented 5 years ago

I make changes in view.py to make responses configurable please review.

anx-ckreuzberger commented 5 years ago

Furthermore, please rename the PR accordingly, and add the "documentation" that is currently in Contributors.md into README.md within the configuration / settings section - e.g., with a heading Configurable Response.

surajraktate commented 5 years ago

Thanks for your PR.

Your change is api-breaking, e.g.: Instead of

return Response({'status': 'OK'})

you use

response_dict = dict({"status_code": None, "message": None})
message = get_response_message("PASSWORD_CHANGED")
response_dict.update({"status_code": 200, "message": message})

return Response(response_dict)

which results in the response {"status_code": 200, "message": "..."} instead of {"status": "OK"}.

Please re-introduce the "status" field.

re-introduces the "status" field in #d7429b6 commit https://github.com/anx-ckreuzberger/django-rest-passwordreset/pull/65/commits/d7429b68436b81ab65f95c22c767a795dc83d5cc

surajraktate commented 3 years ago

sorry for commit without testing, now I can see all checks passed, Thanks