Fixed issue with filter.
This commit is contained in:
@@ -19,7 +19,6 @@ templates = Jinja2Templates(directory=BASE_DIR / "templates")
|
||||
|
||||
from datetime import datetime, timezone
|
||||
|
||||
@templates.env.filters.register
|
||||
def timestamp_to_date(ts):
|
||||
if ts is None:
|
||||
return "Never"
|
||||
@@ -29,6 +28,9 @@ def timestamp_to_date(ts):
|
||||
except (ValueError, TypeError):
|
||||
return "Invalid"
|
||||
|
||||
# Register the filter correctly
|
||||
templates.env.filters["timestamp_to_date"] = timestamp_to_date
|
||||
|
||||
# Static files
|
||||
app.mount("/static", StaticFiles(directory=BASE_DIR / "static"), name="static")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user