Beispiel #1
0
 def save_user(self, request, user, form, commit=True):
     # Automatically create a group for the user.
     user = DefaultAccountAdapter.save_user(self, request, user, form, commit=True)
     group = Group.objects.create(name=user.username)
     group.save()
     user.groups.add(group)
     user.save()
     return user
Beispiel #2
0
 def save_user(self, request, user, form, commit=True):
     # Automatically create a group for the user.
     user = DefaultAccountAdapter.save_user(self, request, user, form, commit=True)
     group = Group.objects.create(name=user.username)
     group.save()
     user.groups.add(group)
     user.save()
     return user
    def save_user(self, request, user, form):
        if not request.user.admin:
            raise PermissionDenied()
        user.email = request.data.get('email')
        user.admin = request.data.get('admin')
        user.passwordChange = True
        user.newIssueNotifications = True

        return DefaultAccountAdapter.save_user(
            self, request, user, form)  # For other default validations.