mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-27 09:26: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 = super().get_initial()
|
||||||
initial['target_schedule'] = timezone.now().replace(
|
initial['target_schedule'] = timezone.now().replace(
|
||||||
second=0, microsecond=0,
|
second=0, microsecond=0,
|
||||||
).isoformat(timespec='minutes')
|
)
|
||||||
for k, v in self.prepopulated_data.items():
|
for k, v in self.prepopulated_data.items():
|
||||||
initial[k] = v
|
initial[k] = v
|
||||||
return initial
|
return initial
|
||||||
@ -398,6 +398,12 @@ class UpdateSourceView(EditSourceMixin, UpdateView):
|
|||||||
|
|
||||||
template_name = 'sync/source-update.html'
|
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):
|
def get_success_url(self):
|
||||||
url = reverse_lazy('sync:source', kwargs={'pk': self.object.pk})
|
url = reverse_lazy('sync:source', kwargs={'pk': self.object.pk})
|
||||||
return append_uri_params(url, {'message': 'source-updated'})
|
return append_uri_params(url, {'message': 'source-updated'})
|
||||||
|
Loading…
Reference in New Issue
Block a user