Merge branch 'main' into stvnrlly-paperless-api

This commit is contained in:
stvnrlly
2023-02-06 12:28:10 -05:00
87 changed files with 2484 additions and 2087 deletions

View File

@@ -101,7 +101,7 @@ def _update_notification_status(notification, status, provider_response=None):
@autocommit
def update_notification_status_by_id(notification_id, status, sent_by=None, detailed_status_code=None):
def update_notification_status_by_id(notification_id, status, sent_by=None):
notification = Notification.query.with_for_update().filter(Notification.id == notification_id).first()
if not notification:
@@ -131,8 +131,7 @@ def update_notification_status_by_id(notification_id, status, sent_by=None, deta
notification.sent_by = sent_by
return _update_notification_status(
notification=notification,
status=status,
detailed_status_code=detailed_status_code
status=status
)

View File

@@ -24,10 +24,8 @@ def get_provider_details_by_identifier(identifier):
def get_alternative_sms_provider(identifier):
if identifier == 'firetext':
return 'mmg'
elif identifier == 'mmg':
return 'firetext'
if identifier == 'sns':
raise Exception("No alternative SMS providers currently available")
raise ValueError('Unrecognised sms provider {}'.format(identifier))