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

[bug] Regression: opening non existing user ID raises an exception #228

Closed
nemesifier opened this issue Jan 30, 2021 · 1 comment · Fixed by #233
Closed

[bug] Regression: opening non existing user ID raises an exception #228

nemesifier opened this issue Jan 30, 2021 · 1 comment · Fixed by #233
Assignees
Labels

Comments

@nemesifier
Copy link
Member

How to replicate the issue:

Try opening:

  • http://localhost:8000/admin/openwisp_users/user/15f0345b-b9c1-44b2-b674-0deac5c7c816/change/
  • http://localhost:8000/admin/openwisp_users/user/WRONG/change/

Expected outcome: 404, no exception raised

Actual outcome: exception is raised.

Cause:

obj = self.model.objects.get(pk=object_id)

Solution:

  • write a failing test for both cases
  • handle both exceptions and raise Http404()
@nemesifier nemesifier added the bug label Jan 30, 2021
@Saurav-Shrivastav
Copy link
Contributor

Saurav-Shrivastav commented Mar 10, 2021

Can I take this up? @nemesisdesign

Saurav-Shrivastav added a commit to Saurav-Shrivastav/openwisp-users that referenced this issue Mar 10, 2021
…sp#228

- Added a test to check the response status on navigating to a non-existing user change page
- Handled exceptions for an invalid UUID and a non-existing user

Fixes openwisp#228
@pandafy pandafy assigned pandafy and Saurav-Shrivastav and unassigned pandafy Mar 10, 2021
Saurav-Shrivastav added a commit to Saurav-Shrivastav/openwisp-users that referenced this issue Mar 10, 2021
…sp#228

- Added a test to check the response status on navigating to a non-existing user change page
- Handled exceptions for an invalid UUID and a non-existing user

Fixes openwisp#228
Saurav-Shrivastav added a commit to Saurav-Shrivastav/openwisp-users that referenced this issue Mar 13, 2021
…sp#228

- Added a test to check the response status on navigating to a non-existing user change page
- Handled exceptions for an invalid UUID and a non-existing user

Fixes openwisp#228
Saurav-Shrivastav added a commit to Saurav-Shrivastav/openwisp-users that referenced this issue Mar 13, 2021
…sp#228

- Added a test to check the response status on navigating to a non-existing user change page
- Handled exceptions for an invalid UUID and a non-existing user

Fixes openwisp#228
Saurav-Shrivastav added a commit to Saurav-Shrivastav/openwisp-users that referenced this issue Mar 13, 2021
…sp#228

- Added a test to check the response status on navigating to a non-existing user change page
- Handled exceptions for an invalid UUID and a non-existing user

Fixes openwisp#228
Saurav-Shrivastav added a commit to Saurav-Shrivastav/openwisp-users that referenced this issue Mar 16, 2021
…sp#228

- Added a test to check the response status on navigating to a non-existing user change page
- Handled exceptions for an invalid UUID and a non-existing user

Fixes openwisp#228
Saurav-Shrivastav added a commit to Saurav-Shrivastav/openwisp-users that referenced this issue Mar 17, 2021
…sp#228

- Added a test to check the response status on navigating to a non-existing user change page
- Handled exceptions for an invalid UUID and a non-existing user

Fixes openwisp#228
Saurav-Shrivastav added a commit to Saurav-Shrivastav/openwisp-users that referenced this issue Mar 20, 2021
…sp#228

- Added a test to check the response status on navigating to a non-existing user change page
- Handled exceptions for an invalid UUID and a non-existing user

Fixes openwisp#228
nemesifier pushed a commit that referenced this issue Mar 20, 2021
- Added a test to check the response status on navigating to a non-existing user change page
- Handled exceptions for an invalid UUID and a non-existing user

Fixes #228
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants