diff options
author | Andrew Godwin | 2022-11-13 16:14:38 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-11-13 16:15:14 -0700 |
commit | 34b24a0dcb044cb755e201ad1a83253d0690e78e (patch) | |
tree | 51e6842d9e1392fafcd617cf4de0fa7e28397c87 /activities/models | |
parent | 5a8b6bb3d022a532562ad5fa6d629cfc48c51b46 (diff) | |
download | takahe-34b24a0dcb044cb755e201ad1a83253d0690e78e.tar.gz takahe-34b24a0dcb044cb755e201ad1a83253d0690e78e.tar.bz2 takahe-34b24a0dcb044cb755e201ad1a83253d0690e78e.zip |
More UI!
Diffstat (limited to 'activities/models')
-rw-r--r-- | activities/models/post.py | 8 |
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}/" |