Get current user in model signal pre_save

2015-09-09 Thread Xavier Palacín Ayuso
I want to collects current user in model signal pre_save, to prevent remove super user permission to current super users. As I have now so I can not give administrative privileges to a normal user. from django.db.models.signals import pre_delete, pre_save, post_save from django.dispatch.dispatche

Hide specific users from auth user model for non super users

2015-09-09 Thread Xavier Palacín Ayuso
I need hide a super admin's users from auth user model of Django of list users template for a normal users or no super admin users. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it

Re: Get current user in model signal pre_save

2015-09-10 Thread Xavier Palacín Ayuso
if obj.is_superuser: if request.user.is_superuser: # obj.delete() else: raise PermissionDenied else: # obj.delete() delete_model.short_description = 'Eliminar usuario/s seleccionados

Re: Hide specific users from auth user model for non super users

2015-09-10 Thread Xavier Palacín Ayuso
avier Palacín Ayuso escribió: > > I need hide a super admin's users from auth user model of Django of list > users template for a normal users or no super admin users. > -- You received this message because you are subscribed to the Google Groups "Django users" group