mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-29 11:30:39 +00:00
fields for content warnings
This commit is contained in:
parent
9b7f0366e7
commit
aacf5b7ba4
2 changed files with 4 additions and 1 deletions
|
@ -23,6 +23,7 @@ class Note(ActivityObject):
|
|||
cc: List[str] = field(default_factory=lambda: [])
|
||||
replies: Dict = field(default_factory=lambda: {})
|
||||
inReplyTo: str = ''
|
||||
summary: str = ''
|
||||
tag: List[Link] = field(default_factory=lambda: [])
|
||||
attachment: List[Image] = field(default_factory=lambda: [])
|
||||
sensitive: bool = False
|
||||
|
|
|
@ -23,6 +23,8 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
|||
default='public',
|
||||
choices=PrivacyLevels.choices
|
||||
)
|
||||
content_warning = fields.CharField(
|
||||
max_length=150, blank=True, null=True, activitypub_field='summary')
|
||||
sensitive = fields.BooleanField(default=False)
|
||||
# the created date can't be this, because of receiving federated posts
|
||||
published_date = fields.DateTimeField(
|
||||
|
@ -68,7 +70,7 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
|||
**kwargs
|
||||
)
|
||||
|
||||
def to_activity(self, pure=False):
|
||||
def to_activity(self, pure=False):# pylint: disable=arguments-differ
|
||||
''' return tombstone if the status is deleted '''
|
||||
if self.deleted:
|
||||
return activitypub.Tombstone(
|
||||
|
|
Loading…
Reference in a new issue