# Handle profile
- def handle_profile(self, profile_id, blob, country_code=None, when=None):
+ def handle_profile(self, profile_id, blob, country_code=None, asn=None, when=None):
private_id = blob.get("private_id", None)
assert private_id
private_id,
version,
blob,
- country_code
+ country_code,
+ asn
)
VALUES
(
%s,
%s,
%s,
+ %s,
%s
)
- """, profile_id, private_id, version, json.dumps(profile), country_code,
+ """, profile_id, private_id, version, json.dumps(profile), country_code, asn,
)
def _validate(self, profile_id, version, blob):
with self.db.transaction():
try:
self.fireinfo.handle_profile(public_id, profile_blob,
- country_code=self.current_country_code)
+ country_code=self.current_country_code,
+ asn=self.current_address.asn if self.current_address else None)
except ValueError as e:
raise tornado.web.HTTPError(400, "Could not process profile: %s" % e)