Skip to content
This repository has been archived by the owner on Jan 26, 2023. It is now read-only.

Commit

Permalink
Raise an error on invalid unsubscription
Browse files Browse the repository at this point in the history
  • Loading branch information
obskyr committed Oct 19, 2016
1 parent f56e1df commit f6656e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion controllers/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ def subscription_delete(client, service):
if l is not None:
db.session.delete(l)
db.session.commit()
return Error.NONE
return Error.NONE
return Error.NOT_SUBSCRIBED
3 changes: 2 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def _e(message, error_code, http_status):
INVALID_PUBKEY = _e.__func__('Invalid public key supplied. Please send a DER formatted base64 encoded key.', 8, 400) # Bad request
CONNECTION_CLOSING = _e.__func__('Connection closing', 9, 499) # Client closed request
NO_CHANGES = _e.__func__('No changes were made', 10, 400) # Bad request

NOT_SUBSCRIBED = _e.__func__('Not subscribed to that service', 11, 409) # Conflict

@staticmethod
def ARGUMENT_MISSING(arg):
return Error._e('Missing argument {}'.format(arg), 7, 400) # Bad request
Expand Down

0 comments on commit f6656e4

Please sign in to comment.