[Django]-Django: userena edit profile forbidden

2👍

Finally digging around django-userena and django-guardian sources I present my output of this little research, so if you want the users to be able to edit their profile you can use the following code

User post save signal which adds ‘change_profile’ permission to new user objects

@receiver(post_save, sender=User, dispatch_uid='user.created')
def user_created(sender, instance, created, raw, using, **kwargs):
  """ Adds 'change_profile' permission to created user objects """
  if created:
    from guardian.shortcuts import assign
    assign('change_profile', instance, instance.get_profile())
👤sultan

1👍

For existing users, Just issue this command and the page will be working:

python manage.py check_permissions
👤Dat TT

Leave a comment