1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

when aging, use a more compact age to stay within username 30 char restriction

This commit is contained in:
Chris Meyers 2015-06-22 13:06:50 -04:00
parent a8f5eff0ae
commit bd61261454

View File

@ -88,9 +88,13 @@ class Command(BaseCommand):
print('unable to find deleted timestamp in %s field' % name_field)
else:
aged_date = dt - datetime.timedelta(days=self.days)
setattr(instance, name_field, name_prefix + aged_date.isoformat() + name_append)
if model is User:
aged_ts_append = aged_date.strftime('%Y-%m-%dT%H:%M:%S.%f')
else:
aged_ts_append = aged_date.isoformat() + name_append
setattr(instance, name_field, name_prefix + aged_ts_append)
instance.save()
#print("Aged %s" % instance.name)
#print("Aged %s" % getattr(instance, name_field))
n_aged_items += 1