mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-01 04:48:44 +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: [])
|
cc: List[str] = field(default_factory=lambda: [])
|
||||||
replies: Dict = field(default_factory=lambda: {})
|
replies: Dict = field(default_factory=lambda: {})
|
||||||
inReplyTo: str = ''
|
inReplyTo: str = ''
|
||||||
|
summary: str = ''
|
||||||
tag: List[Link] = field(default_factory=lambda: [])
|
tag: List[Link] = field(default_factory=lambda: [])
|
||||||
attachment: List[Image] = field(default_factory=lambda: [])
|
attachment: List[Image] = field(default_factory=lambda: [])
|
||||||
sensitive: bool = False
|
sensitive: bool = False
|
||||||
|
|
|
@ -23,6 +23,8 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
||||||
default='public',
|
default='public',
|
||||||
choices=PrivacyLevels.choices
|
choices=PrivacyLevels.choices
|
||||||
)
|
)
|
||||||
|
content_warning = fields.CharField(
|
||||||
|
max_length=150, blank=True, null=True, activitypub_field='summary')
|
||||||
sensitive = fields.BooleanField(default=False)
|
sensitive = fields.BooleanField(default=False)
|
||||||
# the created date can't be this, because of receiving federated posts
|
# the created date can't be this, because of receiving federated posts
|
||||||
published_date = fields.DateTimeField(
|
published_date = fields.DateTimeField(
|
||||||
|
@ -68,7 +70,7 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
def to_activity(self, pure=False):
|
def to_activity(self, pure=False):# pylint: disable=arguments-differ
|
||||||
''' return tombstone if the status is deleted '''
|
''' return tombstone if the status is deleted '''
|
||||||
if self.deleted:
|
if self.deleted:
|
||||||
return activitypub.Tombstone(
|
return activitypub.Tombstone(
|
||||||
|
|
Loading…
Reference in a new issue