Merge "Replace django_date with datetime.datetime.strftime"

This commit is contained in:
Jenkins 2017-03-28 14:25:13 +00:00 committed by Gerrit Code Review
commit 96b54e336b
1 changed files with 2 additions and 4 deletions

View File

@ -13,7 +13,6 @@
import datetime
import pprint
from django.template.defaultfilters import date as django_date
from django.utils.translation import ugettext_lazy as _
from django.views import generic
@ -62,9 +61,8 @@ class RestoreView(workflows.WorkflowView):
@shield('Unable to get backup.', redirect='backups:index')
def get_workflow_name(self):
backup = freezer_api.Backup(self.request).get(self.kwargs['backup_id'])
backup_date = datetime.datetime.fromtimestamp(int(backup.time_stamp))
backup_date_str = django_date(backup_date,
'SHORT_DATETIME_FORMAT')
backup_date_str = datetime.datetime.fromtimestamp(int(backup.time_stamp))\
.strftime("%Y/%m/%d %H:%M")
return "Restore '{}' from {}".format(backup.backup_name,
backup_date_str)