Looks mostly good, but here's some improvements you can make:
if (message_id is None) or (message_type is None):
should be:
if None in (message_id, message_type):
and then:
if to and not (to is ""):
Not sure what you're even trying to do here. if "to" is an empty string, it will evaluate false in python. So this is already equivalent:
if to:
then:
place = entry.get('place') or {} location = place.get('location') or {}
place = entry.get('place', {}) location = place.get('location', {})
and:
if not (picture_url is ''):
can be:
if picture_url:
« Back to merge proposal
Looks mostly good, but here's some improvements you can make:
if (message_id is None) or (message_type is None):
should be:
if None in (message_id, message_type):
and then:
if to and not (to is ""):
Not sure what you're even trying to do here. if "to" is an empty string, it will evaluate false in python. So this is already equivalent:
if to:
then:
place = entry.get('place') or {} 'location' ) or {}
location = place.get(
should be:
place = entry.get('place', {}) 'location' , {})
location = place.get(
and:
if not (picture_url is ''):
can be:
if picture_url: