Skip to content

Commit

Permalink
Run pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
brylie committed Nov 26, 2023
1 parent 5eabe38 commit 65d6183
Show file tree
Hide file tree
Showing 61 changed files with 324 additions and 300 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ dmypy.json
.pyre/

# IDE related ignores
.vscode
.vscode
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
CMD set -xe; gunicorn --worker-tmp-dir /dev/shm core.wsgi:application --bind 0.0.0.0:5000 --workers 3
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
release: python manage.py migrate
release: python manage.py migrate
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion project/accounts/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 2 additions & 2 deletions project/accounts/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
7 changes: 2 additions & 5 deletions project/accounts/forms.py
Original file line number Diff line number Diff line change
@@ -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")
6 changes: 2 additions & 4 deletions project/accounts/models.py
Original file line number Diff line number Diff line change
@@ -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
return self.username
14 changes: 7 additions & 7 deletions project/accounts/templates/registration/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
{% block title %}Log in{% endblock title %}

{% block content %}
<h1>{% translate "Log in" %}</h1>
<h1>{% translate "Log in" %}</h1>

<form action="" method=post>
{% csrf_token %}
{{ form | crispy }}
<button class="btn btn-primary" type="submit">{% translate "Log in" %}</button>
</form>
{% endblock content %}
<form action="" method=post>
{% csrf_token %}
{{ form | crispy }}
<button class="btn btn-primary" type="submit">{% translate "Log in" %}</button>
</form>
{% endblock content %}
14 changes: 7 additions & 7 deletions project/accounts/templates/registration/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
{% block title %}{% translate "Sign up" %}{% endblock title %}

{% block content %}
<h1>{% translate "Sign up" %}</h1>
<h1>{% translate "Sign up" %}</h1>

<form action="" method=post>
{% csrf_token %}
{{ form | crispy }}
<button class="btn btn-primary" type="submit">{% translate "Sign up" %}</button>
</form>
{% endblock content %}
<form action="" method=post>
{% csrf_token %}
{{ form | crispy }}
<button class="btn btn-primary" type="submit">{% translate "Sign up" %}</button>
</form>
{% endblock content %}
2 changes: 0 additions & 2 deletions project/accounts/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from django.test import TestCase

# Create your tests here.
1 change: 1 addition & 0 deletions project/accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from .forms import CustomUserCreationForm


class SignUpView(CreateView):
form_class = CustomUserCreationForm
success_url = reverse_lazy("home")
Expand Down
2 changes: 1 addition & 1 deletion project/activities/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ class Meta:
fields = "__all__"
widgets = {
"date": forms.DateInput(attrs={"type": "date"}),
}
}
12 changes: 5 additions & 7 deletions project/activities/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@


class Activity(models.Model):
"""
Model representing an activity.
"""
"""Model representing an activity."""

class ActivityTypeChoices(models.TextChoices):
"""
Choices for the type of activity.
"""
"""Choices for the type of activity."""

OUTDOOR = "outdoor", _("Outdoor")
CULTURE = "culture", _("Culture")
DISCUSSION = "discussion", _("Discussion")
Expand All @@ -34,7 +32,7 @@ class ActivityTypeChoices(models.TextChoices):
_("Duration in minutes"),
default=30,
)

class Meta:
db_table = "activity"
verbose_name = _("activity")
Expand Down
12 changes: 6 additions & 6 deletions project/activities/templates/activities/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
{% block title %}Add activity{% endblock title %}

{% block content %}
<form action="{% url 'activity-form-view' %}" method="post">
{% csrf_token %}
<form action="{% url 'activity-form-view' %}" method="post">
{% csrf_token %}

{{ form|crispy }}
{{ form|crispy }}

<button type="submit" class="btn btn-primary">Add activity</button>
</form>
{% endblock content %}
<button type="submit" class="btn btn-primary">Add activity</button>
</form>
{% endblock content %}
1 change: 1 addition & 0 deletions project/activities/templates/activities/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ <h1>Activities</h1>
<td>{{ activity.duration_minutes }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
2 changes: 0 additions & 2 deletions project/activities/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from django.test import TestCase

# Create your tests here.
2 changes: 0 additions & 2 deletions project/activities/urls.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
from django.urls import path
from django.utils.translation import gettext_lazy as _

from .views import ActivityFormView, ActivityListView


urlpatterns = [

path(
# . Translators: Make sure to leave the trailing slash "/"
"submit/",
Expand Down
1 change: 1 addition & 0 deletions project/caregivers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from .models import CaregiverRole


@admin.register(CaregiverRole)
class CaregiverRoleAdmin(admin.ModelAdmin):
pass
4 changes: 2 additions & 2 deletions project/caregivers/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@


class CaregiversConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'caregivers'
default_auto_field = "django.db.models.BigAutoField"
name = "caregivers"
2 changes: 0 additions & 2 deletions project/caregivers/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from django.test import TestCase

# Create your tests here.
2 changes: 0 additions & 2 deletions project/caregivers/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from django.shortcuts import render

# Create your views here.
5 changes: 2 additions & 3 deletions project/core/asgi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""
ASGI config for core project.
"""ASGI config for core project.
It exposes the ASGI callable as a module-level variable named ``application``.
Expand All @@ -11,6 +10,6 @@

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings")

application = get_asgi_application()
12 changes: 9 additions & 3 deletions project/core/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""
Django settings for core project.
"""Django settings for core project.
Generated by 'django-admin startproject' using Django 4.0.
Expand Down Expand Up @@ -152,7 +151,14 @@

STATIC_URL = "static/"
STATIC_ROOT = BASE_DIR / "static"
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
STORAGES = {
"default": {
"BACKEND": "django.core.files.storage.FileSystemStorage",
},
"staticfiles": {
"BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage",
},
}

# Default primary key field type
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
Expand Down
3 changes: 1 addition & 2 deletions project/core/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""core URL Configuration
"""Core URL Configuration.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Expand All @@ -15,7 +15,6 @@
"""
from django.contrib import admin
from django.urls import include, path
from django.utils.translation import gettext_lazy as _
from django.views.generic.base import TemplateView

urlpatterns = [
Expand Down
5 changes: 2 additions & 3 deletions project/core/wsgi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""
WSGI config for core project.
"""WSGI config for core project.
It exposes the WSGI callable as a module-level variable named ``application``.
Expand All @@ -11,6 +10,6 @@

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings")

application = get_wsgi_application()
3 changes: 2 additions & 1 deletion project/homes/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from .models import Home


@admin.register(Home)
class HomeAdmin(admin.ModelAdmin):
pass
pass
4 changes: 2 additions & 2 deletions project/homes/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@


class HomesConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'homes'
default_auto_field = "django.db.models.BigAutoField"
name = "homes"
Loading

0 comments on commit 65d6183

Please sign in to comment.