mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-02 16:21:32 -08:00
cope with & in titles
This commit is contained in:
parent
ea224e291b
commit
b072956289
1 changed files with 2 additions and 2 deletions
|
@ -432,7 +432,7 @@ def actor_json_to_model(activity_json, address, server):
|
|||
|
||||
def post_json_to_model(post_json, user, community) -> Post:
|
||||
post = Post(user_id=user.id, community_id=community.id,
|
||||
title=post_json['name'],
|
||||
title=post_json['name'].replace('&', '&'),
|
||||
comments_enabled=post_json['commentsEnabled'],
|
||||
sticky=post_json['stickied'] if 'stickied' in post_json else False,
|
||||
nsfw=post_json['sensitive'],
|
||||
|
@ -987,7 +987,7 @@ def create_post_reply(activity_log: ActivityPubLog, community: Community, in_rep
|
|||
|
||||
def create_post(activity_log: ActivityPubLog, community: Community, request_json: dict, user: User, announce_id=None) -> Union[Post, None]:
|
||||
post = Post(user_id=user.id, community_id=community.id,
|
||||
title=request_json['object']['name'],
|
||||
title=request_json['object']['name'].replace('&', '&'),
|
||||
comments_enabled=request_json['object']['commentsEnabled'],
|
||||
sticky=request_json['object']['stickied'] if 'stickied' in request_json['object'] else False,
|
||||
nsfw=request_json['object']['sensitive'],
|
||||
|
|
Loading…
Add table
Reference in a new issue