I want to get the currently logged in user (request.user) in the save method of models.py. I want to check the role of the user and see if it can p
Have you tried using the following library:
https://pypi.org/project/django-currentuser/
Snippet of how it is used from the website:
from django_currentuser.middleware import (get_current_user, get_current_authenticated_user)
# As model field:
from django_currentuser.db.models import CurrentUserField
class Foo(models.Model):
created_by = CurrentUserField()