fix: strip date string

This commit is contained in:
relikd
2023-06-06 19:33:37 +02:00
parent ad9cd818d6
commit 75f5c80a92

View File

@@ -29,7 +29,8 @@ DEBUG = os.environ.get('DEBUG', 'yes').lower() not in ['false', 'no', '0']
try: try:
with open(BASE_DIR / 'build_date.txt', 'r') as fp: with open(BASE_DIR / 'build_date.txt', 'r') as fp:
BUILD_DATE = datetime.fromisoformat(fp.read()).replace(tzinfo=TZ.utc) raw_date = fp.read().strip()
BUILD_DATE = datetime.fromisoformat(raw_date).replace(tzinfo=TZ.utc)
except FileNotFoundError: except FileNotFoundError:
BUILD_DATE = None BUILD_DATE = None