Skip to content

Commit

Permalink
backend: Don't break if blog entry has no owner user
Browse files Browse the repository at this point in the history
  • Loading branch information
katajakasa committed Apr 20, 2024
1 parent eae3a0c commit 1cf4e75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/Instanssi/api/v2/serializers/blog_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class BlogEntrySerializer(ModelSerializer):
created_by = SerializerMethodField()

def get_created_by(self, entry: BlogEntry) -> str:
return entry.user.get_username()
return entry.user.get_username() if entry.user else ""

class Meta:
model = BlogEntry
Expand Down

0 comments on commit 1cf4e75

Please sign in to comment.