message format fixing

This commit is contained in:
Volkan Şahin 2016-06-30 17:04:44 +03:00
parent ab2e096f7b
commit 065c91ea81

View file

@ -140,11 +140,15 @@ class Messaging(object):
def agreement_request_msg(self): def agreement_request_msg(self):
data = {} data = {}
data['type'] = 'REQUEST_AGREEMENT' data['type'] = 'REQUEST_AGREEMENT'
"""
contract_content = self.db_service.select_one_result('contract', 'content', 'id =(select MAX(id) from contract)') contract_content = self.db_service.select_one_result('contract', 'content', 'id =(select MAX(id) from contract)')
if contract_content is not None and contract_content != '': if contract_content is not None and contract_content != '':
data['md5'] = Util.get_md5_text(contract_content) data['md5'] = Util.get_md5_text(contract_content)
else: else:
data['md5'] = '' data['md5'] = ''
"""
data['timestamp'] = Util.timestamp() data['timestamp'] = Util.timestamp()
json_data = json.dumps(data) json_data = json.dumps(data)
self.logger.debug('[Messaging] Agreement request message was created') self.logger.debug('[Messaging] Agreement request message was created')
@ -154,7 +158,7 @@ class Messaging(object):
data = {} data = {}
data['type'] = 'AGREEMENT_STATUS' data['type'] = 'AGREEMENT_STATUS'
data['username'] = username data['username'] = username
data['accepted'] = str(answer).upper() data['accepted'] = answer
data['timestamp'] = Util.timestamp() data['timestamp'] = Util.timestamp()
contract_content = self.db_service.select_one_result('contract', 'content', 'id =(select MAX(id) from contract)') contract_content = self.db_service.select_one_result('contract', 'content', 'id =(select MAX(id) from contract)')
if contract_content is not None and contract_content != '': if contract_content is not None and contract_content != '':