diff --git a/.gitignore b/.gitignore index 92ee412..ceabbab 100644 --- a/.gitignore +++ b/.gitignore @@ -128,4 +128,4 @@ dmypy.json .pyre/ # IDE related ignores -.vscode \ No newline at end of file +.vscode diff --git a/Dockerfile b/Dockerfile index 506eb16..ba3d108 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,4 +37,4 @@ USER wagtail EXPOSE 5000 # Run the server -CMD set -xe; gunicorn --worker-tmp-dir /dev/shm core.wsgi:application --bind 0.0.0.0:5000 --workers 3 \ No newline at end of file +CMD set -xe; gunicorn --worker-tmp-dir /dev/shm core.wsgi:application --bind 0.0.0.0:5000 --workers 3 diff --git a/Procfile b/Procfile index fce68df..3820060 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -release: python manage.py migrate \ No newline at end of file +release: python manage.py migrate diff --git a/README.md b/README.md index 40ce038..a12a270 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # GeriLife Caregiving -A toolkit for caregivers working to promote wellness in elder-care communities. +A toolkit for caregivers working to promote wellness in elder-care communities. ## License diff --git a/poetry.lock b/poetry.lock index d0c73f2..abdccbd 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "asgiref" diff --git a/project/accounts/admin.py b/project/accounts/admin.py index 64b654e..f7b6a8e 100644 --- a/project/accounts/admin.py +++ b/project/accounts/admin.py @@ -4,9 +4,10 @@ from .forms import CustomUserChangeForm, CustomUserCreationForm from .models import User + @admin.register(User) class CustomUserAdmin(UserAdmin): add_form = CustomUserCreationForm form = CustomUserChangeForm model = User - list_display = ['email', 'username',] + list_display = ["email", "username"] diff --git a/project/accounts/apps.py b/project/accounts/apps.py index 3e3c765..0cb51e6 100644 --- a/project/accounts/apps.py +++ b/project/accounts/apps.py @@ -2,5 +2,5 @@ class AccountsConfig(AppConfig): - default_auto_field = 'django.db.models.BigAutoField' - name = 'accounts' + default_auto_field = "django.db.models.BigAutoField" + name = "accounts" diff --git a/project/accounts/forms.py b/project/accounts/forms.py index 5c9aa8a..0880c9c 100644 --- a/project/accounts/forms.py +++ b/project/accounts/forms.py @@ -1,18 +1,15 @@ -from django import forms from django.contrib.auth.forms import UserCreationForm, UserChangeForm from .models import User class CustomUserCreationForm(UserCreationForm): - class Meta: model = User - fields = ('username', 'email',) + fields = ("username", "email") class CustomUserChangeForm(UserChangeForm): - class Meta: model = User - fields = ('username', 'email',) + fields = ("username", "email") diff --git a/project/accounts/models.py b/project/accounts/models.py index abdf920..b756e6d 100644 --- a/project/accounts/models.py +++ b/project/accounts/models.py @@ -1,14 +1,12 @@ from django.contrib.auth.models import AbstractUser -from django.db import models from django.utils.translation import gettext_lazy as _ class User(AbstractUser): - class Meta: db_table = "user" verbose_name = _("user") verbose_name_plural = _("users") - + def __str__(self): - return self.username \ No newline at end of file + return self.username diff --git a/project/accounts/templates/registration/login.html b/project/accounts/templates/registration/login.html index 2d79cc8..7ea053d 100644 --- a/project/accounts/templates/registration/login.html +++ b/project/accounts/templates/registration/login.html @@ -6,11 +6,11 @@ {% block title %}Log in{% endblock title %} {% block content %} -
{% translate "No work has been recorded yet." %}
{% endif %} -{% endblock content %} \ No newline at end of file +{% endblock content %} diff --git a/project/homes/templates/homes/home_detail_charts.html b/project/homes/templates/homes/home_detail_charts.html index 6981dab..2e02909 100644 --- a/project/homes/templates/homes/home_detail_charts.html +++ b/project/homes/templates/homes/home_detail_charts.html @@ -28,4 +28,4 @@- {% translate "View" %} - | -- {% translate "First name" %} - | -- {% translate "Last initial" %} - | -
---|---|---|
- - - - | -{{ resident.first_name }} | -{{ resident.last_initial }} | -
{% translate "No residents found." %}
-{% endif %} -{% endblock content %} \ No newline at end of file + {% if residents %} ++ {% translate "View" %} + | ++ {% translate "First name" %} + | ++ {% translate "Last initial" %} + | +
---|---|---|
+ + + + | +{{ resident.first_name }} | +{{ resident.last_initial }} | +
{% translate "No residents found." %}
+ {% endif %} +{% endblock content %} diff --git a/project/residents/tests.py b/project/residents/tests.py index b76824d..3caa284 100644 --- a/project/residents/tests.py +++ b/project/residents/tests.py @@ -1,25 +1,23 @@ from django.core.exceptions import ValidationError from django.test import TestCase -from psycopg2 import Date from .models import Residency, Resident from homes.models import Home + class ResidencyTestCase(TestCase): def setUp(self): self.resident = Resident.objects.create( first_name="Test", - last_initial="U" + last_initial="U", ) self.home = Home.objects.create( - name="Test Home" + name="Test Home", ) def test_residency_dates_are_valid(self): - """ - Creating a residency where the move out date is before move in - should raise a validation error - """ + """Creating a residency where the move out date is before move in + should raise a validation error.""" with self.assertRaises(ValidationError): residency = Residency.objects.create( resident=self.resident, @@ -37,10 +35,8 @@ def test_residency_dates_are_valid(self): residency.clean() def test_overlapping_residency_not_allowed(self): - """ - Residents should only live in one home at a time - so overlapping residencies should not be allowed - """ + """Residents should only live in one home at a time so overlapping + residencies should not be allowed.""" with self.assertRaises(ValidationError): # Create a residency that will overlap with the new residency diff --git a/project/residents/urls.py b/project/residents/urls.py index 17834ac..7fa3ff6 100644 --- a/project/residents/urls.py +++ b/project/residents/urls.py @@ -1,5 +1,4 @@ from django.urls import path -from django.utils.translation import gettext_lazy as _ from .views import ( ResidentCreateView, diff --git a/project/residents/views.py b/project/residents/views.py index f9a4077..25fe9d7 100644 --- a/project/residents/views.py +++ b/project/residents/views.py @@ -9,10 +9,10 @@ class ResidentCreateView(CreateView): model = Resident - fields = ["first_name", "last_initial", "on_hiatus",] + fields = ["first_name", "last_initial", "on_hiatus"] -class ResidentDetailView(LoginRequiredMixin,DetailView): +class ResidentDetailView(LoginRequiredMixin, DetailView): model = Resident context_object_name = "resident" template_name = "residents/resident_detail.html" @@ -20,7 +20,7 @@ class ResidentDetailView(LoginRequiredMixin,DetailView): class ResidentUpdateView(LoginRequiredMixin, UpdateView): model = Resident - fields = ["first_name", "last_initial", "on_hiatus",] + fields = ["first_name", "last_initial", "on_hiatus"] class ResidentListView(ListView): diff --git a/project/templates/base.html b/project/templates/base.html index 8216f37..9de1b6d 100644 --- a/project/templates/base.html +++ b/project/templates/base.html @@ -1,26 +1,26 @@ - - - - -