mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
backups: Support multiple backups in one day
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
parent
e815256b22
commit
7997835c27
@ -18,7 +18,8 @@
|
|||||||
Views for the backups app.
|
Views for the backups app.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from datetime import date
|
from datetime import datetime
|
||||||
|
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.contrib.messages.views import SuccessMessageMixin
|
from django.contrib.messages.views import SuccessMessageMixin
|
||||||
from django.http import Http404
|
from django.http import Http404
|
||||||
@ -30,7 +31,6 @@ from urllib.parse import unquote
|
|||||||
|
|
||||||
from plinth.modules import backups
|
from plinth.modules import backups
|
||||||
from .backups import _list_of_all_apps_for_backup
|
from .backups import _list_of_all_apps_for_backup
|
||||||
|
|
||||||
from .forms import CreateArchiveForm, ExportArchiveForm
|
from .forms import CreateArchiveForm, ExportArchiveForm
|
||||||
|
|
||||||
|
|
||||||
@ -68,7 +68,8 @@ class CreateArchiveView(SuccessMessageMixin, FormView):
|
|||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
"""Return the initial data to use for forms on this view."""
|
"""Return the initial data to use for forms on this view."""
|
||||||
initial = super().get_initial()
|
initial = super().get_initial()
|
||||||
initial['name'] = 'FreedomBox_backup_' + str(date.today())
|
initial['name'] = 'FreedomBox_backup_' + datetime.now().strftime(
|
||||||
|
'%Y-%m-%d:%H:%M')
|
||||||
return initial
|
return initial
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user