This repository has been archived by the owner on Sep 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #624 from GreatFruitOmsk/616-bottom-left-data
Average Trust Score and Action Solved on every page
- Loading branch information
Showing
4 changed files
with
23 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
from django import template | ||
from django.conf import settings | ||
from django.utils import timezone | ||
|
||
ALLOWED_SETTINGS = ['MAX_WEEKLY_RA'] | ||
register = template.Library() | ||
|
||
|
||
@register.filter(name='fromunix') | ||
def fromunix(value): | ||
return timezone.datetime.fromtimestamp(value, timezone.get_default_timezone()) | ||
|
||
|
||
@register.simple_tag | ||
def settings_value(name): | ||
return getattr(settings, name, '') if name in ALLOWED_SETTINGS else '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters