mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-03 00:31:25 -08:00
only process post image if post url not banned
This commit is contained in:
parent
5fb05f3e2f
commit
9291821835
1 changed files with 3 additions and 3 deletions
|
@ -1278,12 +1278,12 @@ def create_post(activity_log: ActivityPubLog, community: Community, request_json
|
||||||
url=post.ap_id, user_id=admin.id,
|
url=post.ap_id, user_id=admin.id,
|
||||||
author_id=user.id)
|
author_id=user.id)
|
||||||
db.session.add(notify)
|
db.session.add(notify)
|
||||||
if domain.banned:
|
|
||||||
post = None
|
|
||||||
activity_log.exception_message = domain.name + ' is blocked by admin'
|
|
||||||
if not domain.banned:
|
if not domain.banned:
|
||||||
domain.post_count += 1
|
domain.post_count += 1
|
||||||
post.domain = domain
|
post.domain = domain
|
||||||
|
else:
|
||||||
|
post = None
|
||||||
|
activity_log.exception_message = domain.name + ' is blocked by admin'
|
||||||
if post is not None:
|
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'])
|
||||||
|
|
Loading…
Add table
Reference in a new issue