• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Permission for owner that user account

Resolved: Permission for owner that user account

0
By Isaac Tonny on 16/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I building 2 permission for the user account owner and the apartment owner. Although they have the same code, the user account owner doesn’t work.
permissions.py
views.py
enter image description here enter image description here

Answer:

I think the return expression of the first permission class is not correct. It should be obj, not obj.username because request.user is the instance of the User model.

If you have better answer, please add a comment about this, thank you!

django django-rest-framework rest
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Java Virtual Machines deleted

27/03/2023

Resolved: PyCharm cannot see my newly compiled .pyc see on import

27/03/2023

Resolved: I am facing ERR_HTTP2_PROTOCOL_ERROR on my website

27/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.