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

Replace dictionaries with appropriate response #114

Open
priyanshisharma opened this issue Jun 3, 2020 · 4 comments
Open

Replace dictionaries with appropriate response #114

priyanshisharma opened this issue Jun 3, 2020 · 4 comments
Assignees
Labels
claimed good first issue Good for newcomers

Comments

@priyanshisharma
Copy link
Member

Is your feature request related to a problem? Please describe.
In org.views.py, a lot of Response messages can be replaced by objects from org.responses.py. The same needs to be done.

Describe the solution you'd like
Go to org.views.py and replace response, from an appropriate response from org.responses.py wherever possible.
Example

return Response(
                {"message":"This organisation does not exist"},
                status.HTTP_404_NOT_FOUND
            )

becomes

return Response(
                responses.org_not_present_404,
                status.HTTP_404_NOT_FOUND
            )
@priyanshisharma priyanshisharma added good first issue Good for newcomers available No one has claimed the issue (or) is working on it. labels Jun 3, 2020
@priyanshisharma priyanshisharma mentioned this issue Jun 3, 2020
12 tasks
@aayushbisen
Copy link

I want to work on this issue. 😃

@anshsrtv
Copy link
Member

anshsrtv commented Jun 3, 2020

Glad to know that... @aayushbisen 🎉

@priyanshisharma priyanshisharma added claimed and removed available No one has claimed the issue (or) is working on it. labels Jun 5, 2020
@aayushbisen
Copy link

Is there any dict in org.responses.py for

{"detail": "You are not authorised to view this."}

@priyanshisharma
Copy link
Member Author

@aayushbisen Not exactly but there exists

user_unauthorized_403 = {
    "detail":"You do not have the required permissions."
}

You may see if this satisfies the purpose, or make a new dictionary if required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
claimed good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants