Merge branch 'dev' into feature-ai

This commit is contained in:
shamoon
2025-10-24 16:47:12 -07:00
committed by GitHub
4 changed files with 46 additions and 5 deletions

View File

@@ -127,6 +127,10 @@ class UserViewSet(ModelViewSet):
def update(self, request, *args, **kwargs):
user_to_update: User = self.get_object()
if not request.user.is_superuser and user_to_update.is_superuser:
return HttpResponseForbidden(
"Superusers can only be modified by other superusers",
)
if (
not request.user.is_superuser
and request.data.get("is_superuser") is not None