diff --git a/backend/sophon/core/views.py b/backend/sophon/core/views.py index e7e7069..5c05cdd 100644 --- a/backend/sophon/core/views.py +++ b/backend/sophon/core/views.py @@ -202,6 +202,9 @@ class ResearchGroupViewSet(WriteSophonViewSet): return models.ResearchGroup.objects.order_by("slug").all() def hook_create(self, serializer) -> dict[str, t.Any]: + if self.request.user.is_anonymous: + raise HTTPException(status=403) + # Add the owner field to the serializer return { "owner": self.request.user,