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

AssertionError at /api/v1/users/<user-name>/ #1284

Closed
pyaf opened this issue Mar 10, 2017 · 8 comments
Closed

AssertionError at /api/v1/users/<user-name>/ #1284

pyaf opened this issue Mar 10, 2017 · 8 comments

Comments

@pyaf
Copy link

pyaf commented Mar 10, 2017

Steps to reproduce the error

  • Login with superuser (ex: 'iross' on local development server)
  • visit /api/v1/users/user-name/

Actual behavior

  • AssertionError :

Expected view UserAdminDetail to be called with a URL keyword argument named "username". Fix your URL conf, or set the .lookup_field attribute on the view correctly.

Expected behavior

According to Docs link superuser should be able to see specific user's details (ex: first_name, last_name, email ) and should be able to update them.

@pyaf
Copy link
Author

pyaf commented Mar 10, 2017

I would like to take up this issue.
Approach:

  • /vagrant/cadasta/organization/urls/api/users.py URL conf needs to be fixed.
  • URL keyword argument needs to renamed "username".
  • Write test to assert that the url is resolved perfectly.

@wonderchook
Copy link
Contributor

@dpalomino thoughts on this? The super users do have bugs but since I think I'm the only one that really uses that feature, it hasn't been that big a deal.

@dpalomino
Copy link

Thanks @rishabhiitbhu for raising the issue and for your collaboration. As @wonderchook was mentioning, there are some super user issues that we are not currently targeting because has very low impact.

I'd suggest to take a look at some of the issues that are tagged with "First Contribution Friendly".

You can also find more info here:
https://github.com/Cadasta/cadasta-project-ideas/wiki/GSoC-Outreachy-Issue-Contribution-Process

Thanks!

@pyaf
Copy link
Author

pyaf commented Mar 21, 2017

@dpalomino thanks for your suggestion.

@pyaf pyaf closed this as completed Mar 21, 2017
@oliverroick
Copy link
Member

This issue in itself is valid and should be fixed at some point. Re-opening this.

@oliverroick oliverroick reopened this Mar 21, 2017
@pyaf
Copy link
Author

pyaf commented Mar 21, 2017

@oliverroick we need to rename the URL keyword 'slug' to 'username' in https://github.com/Cadasta/cadasta-platform/blob/master/cadasta/organization/urls/api/users.py this will solve this issue. I can create a PR to fix this if you say so.

@oliverroick
Copy link
Member

I don't mind if you pick this up. Bear in mind, though, that this is a lower priority issue so it might take a while till we review and merge the PR.

@pyaf
Copy link
Author

pyaf commented Mar 21, 2017

@oliverroick I'm fine with that. :)

amplifi pushed a commit that referenced this issue Mar 24, 2017
* url keyword changed from slug to username

* Added tests for urls of organization/urls/api/users.py

* Suggestions applied in test_urls_api.py

* Lint error fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants