Skip to content

Commit

Permalink
fix: entity type for Comment and CommentThread models
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-Salman29 committed Oct 24, 2024
1 parent 63c38a8 commit c850d93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions forum/backends/mysql/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def un_flag_as_abuse(
entity.author.pk,
entity.pk,
has_no_historical_flags,
entity_tpye=entity.type,
entity_type=entity.type,
)

return entity.to_dict()
Expand Down Expand Up @@ -160,7 +160,7 @@ def un_flag_all_as_abuse(cls, entity_id: str, **kwargs: Any) -> dict[str, Any]:
entity.author.pk,
entity.pk,
has_no_historical_flags,
entity_tpye=entity.type,
entity_type=entity.type,
)

return entity.to_dict()
Expand Down
2 changes: 1 addition & 1 deletion forum/backends/mysql/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class Content(models.Model):
@property
def type(self) -> str:
"""Return the type of content as str."""
return ContentType.objects.get_for_model(self).__class__.__name__
return self._meta.object_name or ""

@property
def content_type(self) -> ContentType:
Expand Down

0 comments on commit c850d93

Please sign in to comment.