From 36c4b86d466e19165954ae827e264df5af776d7d Mon Sep 17 00:00:00 2001 From: James Graham Date: Wed, 25 Mar 2020 15:56:08 +0000 Subject: [PATCH 1/4] fix: Update social auth dependency Resolves #577 --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index fab49184..3f87bbc3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 From 4acfe61dabc1dfbffd660a86a91afa69da5bc1c2 Mon Sep 17 00:00:00 2001 From: James Graham Date: Wed, 25 Mar 2020 16:03:11 +0000 Subject: [PATCH 2/4] style: Minor style adjustments to context processors --- .gitignore | 3 ++- lowfat/context.py | 17 +++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 79e036f2..4aba05bf 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,8 @@ backups/ *.log *.log.* -# Python runtime and setup +# Python runtime, setup and testing +.mypy_cache/ __pycache__ env/ venv/ diff --git a/lowfat/context.py b/lowfat/context.py index 10b4f99e..7bf5fe44 100644 --- a/lowfat/context.py +++ b/lowfat/context.py @@ -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 + } From 64762c29234737a64bad14461213142b2498310d Mon Sep 17 00:00:00 2001 From: James Graham Date: Wed, 25 Mar 2020 16:09:24 +0000 Subject: [PATCH 3/4] release: bump version number - patch release --- lowfat/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lowfat/settings.py b/lowfat/settings.py index c3b3affa..51a5f19f 100644 --- a/lowfat/settings.py +++ b/lowfat/settings.py @@ -15,7 +15,7 @@ URL_SRC = "https://github.com/softwaresaved/lowfat" -VERSION = "1.18.1" +VERSION = "1.18.2" SETTINGS_EXPORT = [ 'URL_SRC', From 9632a01d3a9690a810845638805f477ff769c0fd Mon Sep 17 00:00:00 2001 From: James Graham Date: Wed, 25 Mar 2020 16:26:28 +0000 Subject: [PATCH 4/4] fix: Pin crispy-forms version to <1.9 Since 1.9, crispy-forms is no longer compatible with django 1.11 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3f87bbc3..1879bf77 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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