Skip to content

Commit

Permalink
Datasets may not contain a mDate. Use cDate in these cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
pinae committed Feb 14, 2018
1 parent f955752 commit d50f0f8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions password_settings_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,11 @@ def update_from_export_data(self, kgk_manager, blob):
setting = self.settings[i]
if setting.get_domain() == domain_name:
found = True
if datetime.strptime(data_set['mDate'], "%Y-%m-%dT%H:%M:%S") > setting.get_m_date():
if 'mDate' in data_set:
last_modification_date = data_set['mDate']
else:
last_modification_date = data_set['cDate']
if datetime.strptime(last_modification_date, "%Y-%m-%dT%H:%M:%S") > setting.get_m_date():
if 'deleted' in data_set and data_set['deleted']:
self.settings.pop(i)
else:
Expand All @@ -271,7 +275,11 @@ def update_from_export_data(self, kgk_manager, blob):
data_set = self.remote_data[domain_name]
if setting.get_domain() == domain_name:
found = True
if setting.get_m_date() >= datetime.strptime(data_set['mDate'], "%Y-%m-%dT%H:%M:%S"):
if 'mDate' in data_set:
last_modification_date = data_set['mDate']
else:
last_modification_date = data_set['cDate']
if setting.get_m_date() >= datetime.strptime(last_modification_date, "%Y-%m-%dT%H:%M:%S"):
self.update_remote = True
if not found:
self.update_remote = True
Expand Down

0 comments on commit d50f0f8

Please sign in to comment.