mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-02 16:21:32 -08:00
Remove unnecessary if/else clause
function only returns True or raises an Exception for an error
This commit is contained in:
parent
589ee8413a
commit
f247c280e9
1 changed files with 5 additions and 7 deletions
|
@ -432,14 +432,12 @@ def shared_inbox():
|
|||
actor = find_actor_or_create(request_json['actor']) if 'actor' in request_json else None
|
||||
if actor is not None:
|
||||
try:
|
||||
if HttpSignature.verify_request(request, actor.public_key, skip_date=True):
|
||||
if current_app.debug:
|
||||
process_inbox_request(request_json, activity_log.id, ip_address())
|
||||
else:
|
||||
process_inbox_request.delay(request_json, activity_log.id, ip_address())
|
||||
return ''
|
||||
HttpSignature.verify_request(request, actor.public_key, skip_date=True)
|
||||
if current_app.debug:
|
||||
process_inbox_request(request_json, activity_log.id, ip_address())
|
||||
else:
|
||||
activity_log.exception_message = 'Could not verify signature'
|
||||
process_inbox_request.delay(request_json, activity_log.id, ip_address())
|
||||
return ''
|
||||
except VerificationError as e:
|
||||
activity_log.exception_message = 'Could not verify signature: ' + str(e)
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue