def update_status(doc):
 status = get_party_status(doc)
 if (doc.status != status):
  doc.db_set(u'status', status)

def update_status ( doc ) : status = get_party_status ( doc ) if ( doc . status != status ) : doc . db_set ( u'status' , status )
updated redis with a message .