Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
jag1g13 committed Mar 25, 2020
2 parents be6da60 + 9632a01 commit ac90607
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ backups/
*.log
*.log.*

# Python runtime and setup
# Python runtime, setup and testing
.mypy_cache/
__pycache__
env/
venv/
Expand Down
17 changes: 11 additions & 6 deletions lowfat/context.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
"""Context for template"""
"""Context processors to add data to template context."""
from django.contrib.sites.models import Site
from django.utils import timezone

from constance import config


def site(request): # pylint: disable=unused-argument
# type: (...) -> dict
"""Return the site."""
return {
'site': Site.objects.get_current()
}


def organisation(request): # pylint: disable=unused-argument
# type: (...) -> dict
"""Return the organisation."""
return {
'organisation_name': config.ORGANISATION_NAME,
'organisation_website': config.ORGANISATION_WEBSITE,
}


def maintenance(request): # pylint: disable=unused-argument
"""Return true if default maintancance time."""
# type: (...) -> dict
"""Return whether current time is within scheduled maintenance period."""
now = timezone.now()

if now.weekday() == config.MAINTENANCE_DAY and now.hour == config.MAINTENANCE_HOUR:
return {"is_maintenance_time": True}

return {"is_maintenance_time": False}
return {
'is_maintenance_time': now.weekday() == config.MAINTENANCE_DAY and now.hour == config.MAINTENANCE_HOUR
}
2 changes: 1 addition & 1 deletion lowfat/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


URL_SRC = "https://github.com/softwaresaved/lowfat"
VERSION = "1.18.1"
VERSION = "1.18.2"

SETTINGS_EXPORT = [
'URL_SRC',
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ django<2.0
django-constance[database]
django-countries
django-tagulous
django-crispy-forms
django-crispy-forms<1.9
django-datetime-widget
django-dbbackup>=3.2.0
django-extensions
Expand All @@ -19,7 +19,8 @@ pylint>=1.8.2
pylint-django>=0.9.0
pypdf2
python-gnupg
social-auth-app-django
social-auth-app-django~=3.1.0
social-auth-core~=3.3.1
# Report
jupyter
ipython
Expand Down

0 comments on commit ac90607

Please sign in to comment.