User.objects.get(username=usuario)
... will work.
Please post the specific error you're getting including any traceback.
On August 16, 2022 3:30:46 PM CDT, "José Ángel Encinas" <auxiliar.sistemas@casasaterceros.com> wrote:
hi guys, im trying to remove user from a specific group using a function in django but can to do it, can help me someone?this is the functiondef accesstosystem(request):usuario = User.objects.filter(groups__name='revisión')user = User.objects.get(username=usuario)group = Group.objects.get(name='revisión')user.groups.remove(group)kind regards
No comments:
Post a Comment