delete redundant files

This commit is contained in:
Volkan Şahin 2016-07-11 17:56:50 +03:00
parent fc51797468
commit 93ff867404
2 changed files with 5 additions and 1 deletions

View file

@ -66,6 +66,7 @@ class Agreement:
self.logger.debug('[Agreement] Agreement was ignored by {}. Session will be closed'.format(username))
else:
self.logger.error('[Agreement] A problem occurred while executing ask.py. Error Message: {}'.format(str(pout)))
Util.delete_file(agreement_path)
else:
self.logger.error('[Agreement] A problem occurred while executing ask.py (Probably argument fault). Error Message: {}'.format(str(pout)))

View file

@ -59,11 +59,14 @@ class ExecutionManager(object):
transfer_manager.transporter.disconnect()
agreement_content = Util.read_file(System.Ahenk.received_dir_path() + file_name)
Util.delete_file(System.Ahenk.received_dir_path() + file_name)
# TODO
title = 'Kullanıcı Sözleşmesi'
if agreement_content is not None and agreement_content != '':
self.db_service.update('contract', self.db_service.get_cols('contract'), [agreement_content, title, json_data['timestamp']])
old_content = self.db_service.select_one_result('contract', 'content', 'id =(select MAX(id) from contract)')
if old_content is None or Util.get_md5_text(old_content) != Util.get_md5_text(agreement_content):
self.db_service.update('contract', self.db_service.get_cols('contract'), [agreement_content, title, json_data['timestamp']])
except Exception as e:
self.logger.error('[ExecutionManager] A problem occurred while updating agreement. Error Message : {}'.format(str(e)))