summaryrefslogtreecommitdiffstats
path: root/activities/models
diff options
context:
space:
mode:
Diffstat (limited to 'activities/models')
-rw-r--r--activities/models/post.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/activities/models/post.py b/activities/models/post.py
index ec5e629..75a4388 100644
--- a/activities/models/post.py
+++ b/activities/models/post.py
@@ -1,4 +1,4 @@
-from typing import Dict
+from typing import Dict, Optional
import urlman
from django.db import models
@@ -126,10 +126,14 @@ class Post(StatorModel):
### Local creation ###
@classmethod
- def create_local(cls, author: Identity, content: str) -> "Post":
+ def create_local(
+ cls, author: Identity, content: str, summary: Optional[str] = None
+ ) -> "Post":
post = cls.objects.create(
author=author,
content=content,
+ summary=summary or None,
+ sensitive=bool(summary),
local=True,
)
post.object_uri = post.author.actor_uri + f"posts/{post.id}/"