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

Commit

Permalink
Merge pull request #576 from mozilla-services/bug/549
Browse files Browse the repository at this point in the history
bug: Do not remove router_type from UAID info
  • Loading branch information
jrconlin authored Aug 1, 2016
2 parents a0a8d11 + d74c00c commit 2fc8b45
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion autopush/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ def register_user(self, data):
del data["uaid"]
if "router_type" not in data or "connected_at" not in data:
# Not specifying these values will generate an exception in AWS.
raise AutopushException("data is missing router_type"
raise AutopushException("data is missing router_type "
"or connected_at")
# Generate our update expression
expr = "SET " + ", ".join(["%s=:%s" % (x, x) for x in data.keys()])
Expand Down
5 changes: 4 additions & 1 deletion autopush/tests/test_web_webpush.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ def test_router_needs_update(self):
def handle_finish(result):
eq_(result, True)
self.wp.set_status.assert_called_with(503)
assert(self.router_mock.register_user.called)
ru = self.router_mock.register_user
assert(ru.called)
eq_('webpush', ru.call_args[0][0].get('router_type'))

self.finish_deferred.addCallback(handle_finish)

self.wp.post("v1", dummy_token)
Expand Down
1 change: 0 additions & 1 deletion autopush/web/webpush.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def _router_completed(self, response, uaid_data, warning=""):
if response.router_data is not None:
if not response.router_data:
del uaid_data["router_data"]
del uaid_data["router_type"]
else:
uaid_data["router_data"] = response.router_data
uaid_data["connected_at"] = ms_time()
Expand Down

0 comments on commit 2fc8b45

Please sign in to comment.