mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
only process post image if post url not banned
This commit is contained in:
parent
dc87bafaaa
commit
5fb05f3e2f
1 changed files with 4 additions and 4 deletions
|
@ -1284,11 +1284,11 @@ def create_post(activity_log: ActivityPubLog, community: Community, request_json
|
||||||
if not domain.banned:
|
if not domain.banned:
|
||||||
domain.post_count += 1
|
domain.post_count += 1
|
||||||
post.domain = domain
|
post.domain = domain
|
||||||
|
if post is not None:
|
||||||
if 'image' in request_json['object'] and post.image is None:
|
if 'image' in request_json['object'] and post.image is None:
|
||||||
image = File(source_url=request_json['object']['image']['url'])
|
image = File(source_url=request_json['object']['image']['url'])
|
||||||
db.session.add(image)
|
db.session.add(image)
|
||||||
post.image = image
|
post.image = image
|
||||||
if post is not None:
|
|
||||||
db.session.add(post)
|
db.session.add(post)
|
||||||
post.ranking = post_ranking(post.score, post.posted_at)
|
post.ranking = post_ranking(post.score, post.posted_at)
|
||||||
community.post_count += 1
|
community.post_count += 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue