mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-27 01:16:36 +00:00
Do not format the datetime
This commit is contained in:
parent
ec2d9d6914
commit
7e9e6f1262
@ -351,7 +351,7 @@ class AddSourceView(EditSourceMixin, CreateView):
|
||||
initial = super().get_initial()
|
||||
initial['target_schedule'] = timezone.now().replace(
|
||||
second=0, microsecond=0,
|
||||
).isoformat(timespec='minutes')
|
||||
)
|
||||
for k, v in self.prepopulated_data.items():
|
||||
initial[k] = v
|
||||
return initial
|
||||
@ -398,6 +398,12 @@ class UpdateSourceView(EditSourceMixin, UpdateView):
|
||||
|
||||
template_name = 'sync/source-update.html'
|
||||
|
||||
def get_initial(self):
|
||||
initial = super().get_initial()
|
||||
when = getattr(self.object, 'target_schedule') or timezone.now()
|
||||
initial['target_schedule'] = when.replace(second=0, microsecond=0)
|
||||
return initial
|
||||
|
||||
def get_success_url(self):
|
||||
url = reverse_lazy('sync:source', kwargs={'pk': self.object.pk})
|
||||
return append_uri_params(url, {'message': 'source-updated'})
|
||||
|
Loading…
Reference in New Issue
Block a user