diff --git a/src/openforms/submissions/models/submission.py b/src/openforms/submissions/models/submission.py index a9930057b0..db82e32446 100644 --- a/src/openforms/submissions/models/submission.py +++ b/src/openforms/submissions/models/submission.py @@ -10,6 +10,7 @@ from django.db import models, transaction from django.utils.formats import localize from django.utils.functional import cached_property +from django.utils.timezone import localtime from django.utils.translation import get_language, gettext_lazy as _ import elasticapm @@ -331,7 +332,7 @@ class Meta: def __str__(self): return _("{pk} - started on {started}").format( pk=self.pk or _("(unsaved)"), - started=localize(self.created_on) or _("(no timestamp yet)"), + started=localize(localtime(self.created_on)) or _("(no timestamp yet)"), ) def refresh_from_db(self, *args, **kwargs): diff --git a/src/openforms/submissions/tests/test_models.py b/src/openforms/submissions/tests/test_models.py index 26aada3d6c..fe45c832d1 100644 --- a/src/openforms/submissions/tests/test_models.py +++ b/src/openforms/submissions/tests/test_models.py @@ -36,7 +36,7 @@ class SubmissionTests(TestCase): def test_submission_str(self): submission = SubmissionFactory.create() self.assertEqual( - str(submission), f"{submission.pk} - started on Nov. 26, 2021, 4 p.m." + str(submission), f"{submission.pk} - started on Nov. 26, 2021, 5 p.m." ) def test_submission_data_with_selectboxes_formio_formatters(self):