From 34b24a0dcb044cb755e201ad1a83253d0690e78e Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sun, 13 Nov 2022 16:14:38 -0700 Subject: More UI! --- activities/models/post.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'activities/models') 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}/" -- cgit v1.2.3