diff options
author | Teddy <ted.sybil@gmail.com> | 2013-09-01 10:32:23 +0800 |
---|---|---|
committer | Teddy <ted.sybil@gmail.com> | 2013-09-01 10:32:23 +0800 |
commit | 096ca60866991ccfd218c7af9b79757cd4fdd4c5 (patch) | |
tree | 9b6b48c59d9f82c7ddaaa92713090fd099dba891 /server/piztor/server.py | |
parent | c2ac1f73431bbcef437aac017465865e5fb086d9 (diff) |
ptp v2.0d
Diffstat (limited to 'server/piztor/server.py')
-rw-r--r-- | server/piztor/server.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/piztor/server.py b/server/piztor/server.py index 9435ccc..512eb68 100644 --- a/server/piztor/server.py +++ b/server/piztor/server.py @@ -70,6 +70,7 @@ class _StatusCode: auth_fail = 0x01 insuf_lvl = 0x02 wrong_pass = 0x03 + grp_not_found = 0x04 class PushData(object): from hashlib import sha256 @@ -476,7 +477,10 @@ class UpdateSubscription(RequestHandler): logger.warning("Authentication failure") return self.pack(struct.pack("!B", _StatusCode.auth_fail)) - uauth.user.sub = map(self._find_group, sub_list) + try: + uauth.user.sub = map(self._find_group, sub_list) + except BadReqError: + return self.pack(struct.pack("!B", _StatusCode.grp_not_found)) self.session.commit() logger.info("Subscription is updated sucessfully") |