Prevent error messages to be unique by removing timestamp

This commit is contained in:
Georg Krause 2022-09-13 09:59:18 +02:00
parent fb10d1a3d5
commit d147e222a4
No known key found for this signature in database
GPG Key ID: 2970D504B2183D22
1 changed files with 2 additions and 1 deletions

View File

@ -31,8 +31,9 @@ def verify_date(raw_date):
delta = datetime.timedelta(seconds=DATE_HEADER_VALID_FOR)
now = timezone.now()
if dt < now - delta or dt > now + delta:
logger.error(f"Request Date {raw_date} is too too far in the future or in the past")
raise forms.ValidationError(
"Request Date {} is too far in the future or in the past".format(raw_date)
"Request Date is too far in the future or in the past"
)
return dt