fix(profiles): cannot access profile if user is anonymous
This commit is contained in:
parent
e9db50c18b
commit
73828bbd8e
@ -24,7 +24,7 @@ class ProfileSerializer(serializers.ModelSerializer):
|
||||
if request and hasattr(request, "user"):
|
||||
user = request.user
|
||||
|
||||
if user is None:
|
||||
if user is None or not user.is_authenticated:
|
||||
return None
|
||||
|
||||
if not user.profilemodel.is_friend(obj) and user.pk != obj.pk:
|
||||
|
Loading…
Reference in New Issue
Block a user