From a681b4d63b40bee0ed938b7037ff7fc1bdcfb976 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Wed, 30 Jul 2025 18:34:22 -0400 Subject: [PATCH] [notifications] Fix a few typos --- vrobbler/apps/scrobbles/notifications.py | 8 ++++---- vrobbler/apps/scrobbles/utils.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vrobbler/apps/scrobbles/notifications.py b/vrobbler/apps/scrobbles/notifications.py index a2b6b6c..f8f44bd 100644 --- a/vrobbler/apps/scrobbles/notifications.py +++ b/vrobbler/apps/scrobbles/notifications.py @@ -3,6 +3,7 @@ import requests from django.conf import settings from django.contrib.sites.models import Site +from django.urls import reverse class BasicNtfyNotification(ABC): ntfy_headers: dict = {} @@ -10,7 +11,7 @@ class BasicNtfyNotification(ABC): title: str = "" def __init__(self, profile: "UserProfile"): - self.user = profile.user + self.profile = profile.user protocol = "http" if settings.DEBUG else "https" domain = Site.objects.get_current().domain self.url_tmpl = f'{protocol}://{domain}' + '{path}' @@ -69,8 +70,7 @@ class ScrobbleNtfyNotification(ScrobbleNotification): class MoodNtfyNotification(BasicNtfyNotification): def __init__(self, profile, **kwargs): - super().__init__(scrobble) - self.profile = profile + super().__init__(profile) self.ntfy_str: str = "Would you like to check in about your mood?" self.click_url = self.url_tmpl.format(path=reverse("moods:mood-list")) self.title = "Mood Check-in!" @@ -82,7 +82,7 @@ class MoodNtfyNotification(BasicNtfyNotification): and self.profile.ntfy_url ): requests.post( - self.user.profile.ntfy_url, + self.profile.ntfy_url, data=self.ntfy_str.encode(encoding="utf-8"), headers={ "Title": self.title, diff --git a/vrobbler/apps/scrobbles/utils.py b/vrobbler/apps/scrobbles/utils.py index 12044e8..659bf10 100644 --- a/vrobbler/apps/scrobbles/utils.py +++ b/vrobbler/apps/scrobbles/utils.py @@ -330,7 +330,7 @@ def send_mood_checkin_reminders() -> int: now = timezone.now() notifications_sent = 0 for profile in UserProfile.objects.filter(mood_checkin_enabled=True): - if profile.mood_checkin_period == "hourly" and now.minute == 0: + if profile.mood_checkin_frequency == "hourly" and now.minute == 0: MoodNtfyNotification(profile).send() notifications_sent += 1