From bd61261454c8293e5979333a4e39387b5be0ffea Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Mon, 22 Jun 2015 13:06:50 -0400 Subject: [PATCH] when aging, use a more compact age to stay within username 30 char restriction --- awx/main/management/commands/age_deleted.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/awx/main/management/commands/age_deleted.py b/awx/main/management/commands/age_deleted.py index 6a6f0ef651..02d1515347 100644 --- a/awx/main/management/commands/age_deleted.py +++ b/awx/main/management/commands/age_deleted.py @@ -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