FIX: some localtime issues.
This commit is contained in:
@@ -7,6 +7,7 @@ from django.apps import apps
|
||||
from django.contrib import messages
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.urls import reverse_lazy
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.views import generic
|
||||
|
||||
@@ -68,7 +69,7 @@ class UploadView(generic.edit.FormView):
|
||||
base_path = app_config.settings.upload_path
|
||||
|
||||
subdir_format_str = u'{datetime}--{title}'
|
||||
now = datetime.datetime.now()
|
||||
now = timezone.now()
|
||||
subdir_format_kwargs = {'datetime': now.strftime('%Y-%m-%d--%H%M%S'),
|
||||
'date': now.strftime('%Y-%m-%d'),
|
||||
'time': now.strftime('%H-%M-%S'),
|
||||
@@ -95,8 +96,8 @@ Beschreibung:
|
||||
{description}
|
||||
"""
|
||||
metadata_format_kwargs = {
|
||||
'date': now.strftime('%d.%m.%Y'),
|
||||
'time': now.strftime('%H:%M:%S'),
|
||||
'date': timezone.localtime(now).strftime('%d.%m.%Y'),
|
||||
'time': timezone.localtime(now).strftime('%H:%M:%S %Z'),
|
||||
'name': form.cleaned_data['name'],
|
||||
'email_address': form.cleaned_data['email_address'],
|
||||
'group': form.cleaned_data['group'],
|
||||
|
||||
Reference in New Issue
Block a user