diff --git a/api/admin.py b/api/admin.py
index 8c38f3f..b97a94f 100644
--- a/api/admin.py
+++ b/api/admin.py
@@ -1,3 +1,2 @@
-from django.contrib import admin
# Register your models here.
diff --git a/api/models.py b/api/models.py
index 71a8362..35e0d64 100644
--- a/api/models.py
+++ b/api/models.py
@@ -1,3 +1,2 @@
-from django.db import models
# Create your models here.
diff --git a/api/tests.py b/api/tests.py
index 7ce503c..4929020 100644
--- a/api/tests.py
+++ b/api/tests.py
@@ -1,3 +1,2 @@
-from django.test import TestCase
# Create your tests here.
diff --git a/cbt/admin.py b/cbt/admin.py
index 8c38f3f..b97a94f 100644
--- a/cbt/admin.py
+++ b/cbt/admin.py
@@ -1,3 +1,2 @@
-from django.contrib import admin
# Register your models here.
diff --git a/cbt/tests.py b/cbt/tests.py
index 7ce503c..4929020 100644
--- a/cbt/tests.py
+++ b/cbt/tests.py
@@ -1,3 +1,2 @@
-from django.test import TestCase
# Create your tests here.
diff --git a/common/admin.py b/common/admin.py
index 8c38f3f..b97a94f 100644
--- a/common/admin.py
+++ b/common/admin.py
@@ -1,3 +1,2 @@
-from django.contrib import admin
# Register your models here.
diff --git a/common/fields.py b/common/fields.py
index 4f1593c..6b11e00 100644
--- a/common/fields.py
+++ b/common/fields.py
@@ -1,5 +1,5 @@
from django.db import models
-from django.core.validators import MinValueValidator, MaxValueValidator, validate_comma_separated_integer_list
+from django.core.validators import MinValueValidator, MaxValueValidator
from multiselectfield import MultiSelectField
diff --git a/common/models.py b/common/models.py
index 71a8362..35e0d64 100644
--- a/common/models.py
+++ b/common/models.py
@@ -1,3 +1,2 @@
-from django.db import models
# Create your models here.
diff --git a/common/tests.py b/common/tests.py
index 7ce503c..4929020 100644
--- a/common/tests.py
+++ b/common/tests.py
@@ -1,3 +1,2 @@
-from django.test import TestCase
# Create your tests here.
diff --git a/common/views.py b/common/views.py
index 91ea44a..b8e4ee0 100644
--- a/common/views.py
+++ b/common/views.py
@@ -1,3 +1,2 @@
-from django.shortcuts import render
# Create your views here.
diff --git a/cronhandler/admin.py b/cronhandler/admin.py
index 8c38f3f..b97a94f 100644
--- a/cronhandler/admin.py
+++ b/cronhandler/admin.py
@@ -1,3 +1,2 @@
-from django.contrib import admin
# Register your models here.
diff --git a/cronhandler/models.py b/cronhandler/models.py
index 71a8362..35e0d64 100644
--- a/cronhandler/models.py
+++ b/cronhandler/models.py
@@ -1,3 +1,2 @@
-from django.db import models
# Create your models here.
diff --git a/cronhandler/tests.py b/cronhandler/tests.py
index 7ce503c..4929020 100644
--- a/cronhandler/tests.py
+++ b/cronhandler/tests.py
@@ -1,3 +1,2 @@
-from django.test import TestCase
# Create your tests here.
diff --git a/dreams/tests.py b/dreams/tests.py
index 7ce503c..4929020 100644
--- a/dreams/tests.py
+++ b/dreams/tests.py
@@ -1,3 +1,2 @@
-from django.test import TestCase
# Create your tests here.
diff --git a/dreams/urls.py b/dreams/urls.py
index 0375aab..b51ef56 100644
--- a/dreams/urls.py
+++ b/dreams/urls.py
@@ -1,6 +1,6 @@
from .views import DreamListView, DreamViewView, DreamDeleteView, DreamEditView, DreamCreateView, ThemeListView, ThemeEditView, ThemeCreateView, ThemeDeleteView, NotificationCreateView, NotificationDeleteView, NotificationEditView, NotificationListView
-from django.urls import path, include
+from django.urls import path
app_name = "dreams"
diff --git a/dreams/views.py b/dreams/views.py
index bcf46f9..d87ccaf 100644
--- a/dreams/views.py
+++ b/dreams/views.py
@@ -1,6 +1,5 @@
-from django.shortcuts import render
-from django.views.generic import TemplateView, ListView, UpdateView, DetailView, CreateView, DeleteView
+from django.views.generic import ListView, UpdateView, DetailView, CreateView, DeleteView
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy
@@ -93,11 +92,11 @@ class DreamEditView(LoginRequiredMixin, UpdateView):
def form_valid(self, form):
for theme in form.cleaned_data["themes"]:
if theme.user == self.request.user:
- if not theme in form.instance.theme_set:
+ if theme not in form.instance.theme_set:
DreamTheme.objects.create(theme=theme, dream=form.instance)
for dreamtheme in form.instance.dreamtheme_set.all():
- if not dreamtheme.theme in form.cleaned_data["themes"]:
+ if dreamtheme.theme not in form.cleaned_data["themes"]:
dreamtheme.delete()
for attachment in form.cleaned_data["uploads"]:
diff --git a/environment/admin.py b/environment/admin.py
index 8c38f3f..b97a94f 100644
--- a/environment/admin.py
+++ b/environment/admin.py
@@ -1,3 +1,2 @@
-from django.contrib import admin
# Register your models here.
diff --git a/environment/models.py b/environment/models.py
index 71a8362..35e0d64 100644
--- a/environment/models.py
+++ b/environment/models.py
@@ -1,3 +1,2 @@
-from django.db import models
# Create your models here.
diff --git a/environment/tests.py b/environment/tests.py
index 7ce503c..4929020 100644
--- a/environment/tests.py
+++ b/environment/tests.py
@@ -1,3 +1,2 @@
-from django.test import TestCase
# Create your tests here.
diff --git a/environment/views.py b/environment/views.py
index 91ea44a..b8e4ee0 100644
--- a/environment/views.py
+++ b/environment/views.py
@@ -1,3 +1,2 @@
-from django.shortcuts import render
# Create your views here.
diff --git a/friends/admin.py b/friends/admin.py
index 8c38f3f..b97a94f 100644
--- a/friends/admin.py
+++ b/friends/admin.py
@@ -1,3 +1,2 @@
-from django.contrib import admin
# Register your models here.
diff --git a/friends/models.py b/friends/models.py
index 71a8362..35e0d64 100644
--- a/friends/models.py
+++ b/friends/models.py
@@ -1,3 +1,2 @@
-from django.db import models
# Create your models here.
diff --git a/friends/tests.py b/friends/tests.py
index 7ce503c..4929020 100644
--- a/friends/tests.py
+++ b/friends/tests.py
@@ -1,3 +1,2 @@
-from django.test import TestCase
# Create your tests here.
diff --git a/friends/views.py b/friends/views.py
index 91ea44a..b8e4ee0 100644
--- a/friends/views.py
+++ b/friends/views.py
@@ -1,3 +1,2 @@
-from django.shortcuts import render
# Create your views here.
diff --git a/frontend/admin.py b/frontend/admin.py
index 8c38f3f..b97a94f 100644
--- a/frontend/admin.py
+++ b/frontend/admin.py
@@ -1,3 +1,2 @@
-from django.contrib import admin
# Register your models here.
diff --git a/frontend/classes.py b/frontend/classes.py
index 421a950..5e45322 100644
--- a/frontend/classes.py
+++ b/frontend/classes.py
@@ -16,7 +16,7 @@ class NavSection:
self.items.sort(key=lambda x: x.order)
for item in self.items:
- html += f"""
+ html += """
diff --git a/frontend/models.py b/frontend/models.py
index 71a8362..35e0d64 100644
--- a/frontend/models.py
+++ b/frontend/models.py
@@ -1,3 +1,2 @@
-from django.db import models
# Create your models here.
diff --git a/frontend/static/frontend/css/frontend.css b/frontend/static/frontend/css/frontend.css
new file mode 100644
index 0000000..2f3d042
--- /dev/null
+++ b/frontend/static/frontend/css/frontend.css
@@ -0,0 +1,32 @@
+.heatmap-container {
+ height: 150px;
+ }
+
+ .card {
+ border-radius: 10px; /* Rounded corners */
+ }
+
+ .card-header {
+ background-color: #f8f9fc; /* Light background for headers */
+ border-bottom: none; /* Remove border */
+ }
+
+ .card-body {
+ padding: 1.5rem; /* Increase padding */
+ }
+
+ .text-uppercase {
+ letter-spacing: 0.05em; /* Slightly increased letter spacing */
+ }
+
+ .h5 {
+ font-size: 1.25rem; /* Slightly larger font size */
+ }
+
+ .mb-4 {
+ margin-bottom: 1.5rem !important; /* Consistent spacing */
+ }
+
+ .shadow-sm {
+ box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important; /* Subtle shadow */
+ }
\ No newline at end of file
diff --git a/frontend/templatetags/navigation.py b/frontend/templatetags/navigation.py
index 6c33f41..957d075 100644
--- a/frontend/templatetags/navigation.py
+++ b/frontend/templatetags/navigation.py
@@ -15,9 +15,9 @@ def sidebar_nav():
features = import_module(f"{module}.features")
try:
sections += features.NAV_SECTIONS
- except:
+ except Exception:
pass
- except:
+ except Exception:
pass
return """
diff --git a/frontend/tests.py b/frontend/tests.py
index 7ce503c..4929020 100644
--- a/frontend/tests.py
+++ b/frontend/tests.py
@@ -1,3 +1,2 @@
-from django.test import TestCase
# Create your tests here.
diff --git a/frontend/urls.py b/frontend/urls.py
index d2a3b5c..9c951a8 100644
--- a/frontend/urls.py
+++ b/frontend/urls.py
@@ -1,6 +1,6 @@
from .views import DashboardView, UserRegistrationView
-from django.urls import path, include
+from django.urls import path
app_name = "frontend"
diff --git a/gpslog/admin.py b/gpslog/admin.py
index 8c38f3f..b97a94f 100644
--- a/gpslog/admin.py
+++ b/gpslog/admin.py
@@ -1,3 +1,2 @@
-from django.contrib import admin
# Register your models here.
diff --git a/gpslog/tests.py b/gpslog/tests.py
index 7ce503c..4929020 100644
--- a/gpslog/tests.py
+++ b/gpslog/tests.py
@@ -1,3 +1,2 @@
-from django.test import TestCase
# Create your tests here.
diff --git a/gpslog/views.py b/gpslog/views.py
index 019d7dd..b3d802a 100644
--- a/gpslog/views.py
+++ b/gpslog/views.py
@@ -4,10 +4,11 @@ from django.shortcuts import get_object_or_404
from django.utils import timezone
from django.contrib.gis.geos import Point
-from .models import GPSTrack, GPSToken, GPSPoint
+from .models import GPSTrack, GPSToken
class GPSLogView(LoginRequiredMixin, View):
+ # TODO: Finish this view
def dispatch(self, request, *args, **kwargs):
self.gps_track = get_object_or_404(GPSTrack, id=self.kwargs["track"])
self.gps_token = get_object_or_404(
@@ -27,11 +28,9 @@ class GPSLogView(LoginRequiredMixin, View):
alt = request.GET.get("alt", None)
- point = Point(lat, lon, alt)
-
- tst = request.GET.get("tst", timezone.now().timestamp())
-
+ point = Point(lat, lon, alt) # noqa: F841
+ tst = request.GET.get("tst", timezone.now().timestamp()) # noqa: F841
def post(self, request, *args, **kwargs):
pass
diff --git a/habits/admin.py b/habits/admin.py
index 8c38f3f..b97a94f 100644
--- a/habits/admin.py
+++ b/habits/admin.py
@@ -1,3 +1,2 @@
-from django.contrib import admin
# Register your models here.
diff --git a/habits/tests.py b/habits/tests.py
index 7ce503c..4929020 100644
--- a/habits/tests.py
+++ b/habits/tests.py
@@ -1,3 +1,2 @@
-from django.test import TestCase
# Create your tests here.
diff --git a/habits/views.py b/habits/views.py
index 91ea44a..b8e4ee0 100644
--- a/habits/views.py
+++ b/habits/views.py
@@ -1,3 +1,2 @@
-from django.shortcuts import render
# Create your views here.
diff --git a/health/admin.py b/health/admin.py
index 8c38f3f..b97a94f 100644
--- a/health/admin.py
+++ b/health/admin.py
@@ -1,3 +1,2 @@
-from django.contrib import admin
# Register your models here.
diff --git a/health/models.py b/health/models.py
index a6264a0..26be059 100644
--- a/health/models.py
+++ b/health/models.py
@@ -35,12 +35,12 @@ class Medication(models.Model):
prn = models.BooleanField(default=False)
remarks = models.TextField(null=True, blank=True)
-class MedicationSchedule(models.Model):
- class ScheduleChoices(models.IntegerChoices):
- DAYS = 0
- WEEKS = 1
- MONTHS = 2
+class ScheduleChoices(models.IntegerChoices):
+ DAYS = 0
+ WEEKS = 1
+ MONTHS = 2
+class MedicationSchedule(models.Model):
medication = models.ForeignKey(Medication, models.CASCADE)
cycle_type = models.IntegerField(choices=ScheduleChoices.choices)
diff --git a/health/tests.py b/health/tests.py
index 7ce503c..4929020 100644
--- a/health/tests.py
+++ b/health/tests.py
@@ -1,3 +1,2 @@
-from django.test import TestCase
# Create your tests here.
diff --git a/health/views.py b/health/views.py
index 91ea44a..b8e4ee0 100644
--- a/health/views.py
+++ b/health/views.py
@@ -1,3 +1,2 @@
-from django.shortcuts import render
# Create your views here.
diff --git a/mood/statistics.py b/mood/statistics.py
index 2d3c154..efc5d23 100644
--- a/mood/statistics.py
+++ b/mood/statistics.py
@@ -72,7 +72,7 @@ def activitystats(user):
for status in Status.objects.filter(user=user):
for activity in status.activity_set:
- if not activity in output.keys():
+ if activity not in output.keys():
output[activity] = {
"alltime": 0,
"yearly": 0,
@@ -275,8 +275,6 @@ def activitymood(activity):
def activitypies(activity):
hv.extension("bokeh")
- maxdate = timezone.now()
-
sa = StatusActivity.objects.filter(activity=activity)
weekly = dict()
diff --git a/mood/templatetags/mood_stats.py b/mood/templatetags/mood_stats.py
index e974d2d..1f987e6 100644
--- a/mood/templatetags/mood_stats.py
+++ b/mood/templatetags/mood_stats.py
@@ -56,7 +56,7 @@ def average_mood(context, start, end=None, daily_averages=True):
for status in status_list:
if status.mood:
if daily_averages:
- if not status.timestamp.date() in moods.keys():
+ if status.timestamp.date() not in moods.keys():
moods[status.timestamp.date()] = [status.mood.value]
else:
moods[status.timestamp.date()].append(status.mood.value)
diff --git a/mood/tests.py b/mood/tests.py
index 7ce503c..4929020 100644
--- a/mood/tests.py
+++ b/mood/tests.py
@@ -1,3 +1,2 @@
-from django.test import TestCase
# Create your tests here.
diff --git a/mood/urls.py b/mood/urls.py
index d3be7bb..19a3580 100644
--- a/mood/urls.py
+++ b/mood/urls.py
@@ -24,7 +24,7 @@ from .views import (
MoodCountHeatmapJSONView,
)
-from django.urls import path, include
+from django.urls import path
app_name = "mood"
diff --git a/mood/views.py b/mood/views.py
index 6a44979..c70f2b5 100644
--- a/mood/views.py
+++ b/mood/views.py
@@ -131,13 +131,13 @@ class StatusEditView(LoginRequiredMixin, UpdateView):
for activity in form.cleaned_data["activities"]:
if activity.user == self.request.user:
- if not activity in form.instance.activity_set:
+ if activity not in form.instance.activity_set:
StatusActivity.objects.create(
activity=activity, status=form.instance
)
for statusactivity in form.instance.statusactivity_set.all():
- if not statusactivity.activity in form.cleaned_data["activities"]:
+ if statusactivity.activity not in form.cleaned_data["activities"]:
statusactivity.delete()
return super().form_valid(form)
@@ -419,7 +419,8 @@ class MoodStatisticsView(LoginRequiredMixin, TemplateView):
if startdate:
mindate = datetime.strptime(startdate, "%Y-%m-%d")
else:
- mindate = maxdate - relativedelta.relativedelta(weeks=1)
+ mindate = maxdate - relativedelta.relativedelta(weeks=1) # noqa: F841
+ # TODO: Do something with this...?
context = super().get_context_data(**kwargs)
context["title"] = "Statistics"
diff --git a/msgio/gateways/matrix.py b/msgio/gateways/matrix.py
index ac83d80..66c6e5d 100644
--- a/msgio/gateways/matrix.py
+++ b/msgio/gateways/matrix.py
@@ -1,7 +1,5 @@
-from django.views.generic import View
from django.dispatch import receiver
-import json
import asyncio
from nio import AsyncClient
diff --git a/msgio/gateways/telegram.py b/msgio/gateways/telegram.py
index 9feaefd..5045eb1 100644
--- a/msgio/gateways/telegram.py
+++ b/msgio/gateways/telegram.py
@@ -1,7 +1,6 @@
from django.views.generic import View
from django.dispatch import receiver
-import json
import telegram
diff --git a/msgio/handler.py b/msgio/handler.py
index ec9413d..1647746 100644
--- a/msgio/handler.py
+++ b/msgio/handler.py
@@ -15,7 +15,7 @@ def send_notifications(sender, **kwargs):
returns.append(notification.send())
datetime.sent = True
datetime.save()
- except:
+ except Exception:
pass # TODO: Implement some sort of error logging / admin notification
for daily in notification.notificationdailyschedule_set.all():
if ((not daily.last_sent) or daily.last_sent < localtime(now()).date()) and daily.time <= localtime(now()).time():
@@ -23,7 +23,7 @@ def send_notifications(sender, **kwargs):
returns.append(notification.send())
daily.last_sent = localtime(now()).date()
daily.save()
- except:
+ except Exception:
pass # TODO: See above
return returns
diff --git a/msgio/management/commands/telegram.py b/msgio/management/commands/telegram.py
index 5a22d45..e11a71e 100644
--- a/msgio/management/commands/telegram.py
+++ b/msgio/management/commands/telegram.py
@@ -1,4 +1,4 @@
-from django.core.management.base import BaseCommand, CommandError
+from django.core.management.base import BaseCommand
from dbsettings.functions import dbsettings
diff --git a/msgio/tests.py b/msgio/tests.py
index 7ce503c..4929020 100644
--- a/msgio/tests.py
+++ b/msgio/tests.py
@@ -1,3 +1,2 @@
-from django.test import TestCase
# Create your tests here.
diff --git a/msgio/views.py b/msgio/views.py
index eb9a559..139597f 100644
--- a/msgio/views.py
+++ b/msgio/views.py
@@ -1,6 +1,2 @@
-from .handler import send_notifications
-from .gateways.telegram import TelegramWebhookView
-import msgio.gateways.matrix
-import msgio.gateways.telegram
\ No newline at end of file
diff --git a/passenger_wsgi.py b/passenger_wsgi.py
index 2fa0def..e69de29 100644
--- a/passenger_wsgi.py
+++ b/passenger_wsgi.py
@@ -1 +0,0 @@
-from kumify.wsgi import application