Fix OAuth page
This commit is contained in:
@@ -24,6 +24,8 @@ from .forms import (
|
||||
)
|
||||
from .models import BowelHealthCheckIn, FastingPeriod, FastingSettings, NeckHeadacheCheckIn, SickDaySettings, SleepCheckIn, Task, ToothBrushing, UserSettings, Workout, WaterIntakeEntry
|
||||
from .services.hydration import hydration_context
|
||||
from stress.services import daily_widget_context
|
||||
from dreams.models import DreamEntry
|
||||
from .services.gitea_activity import activity_context
|
||||
from .services.notifications import NotificationError, send_ntfy_notification
|
||||
from .services.checkins import (
|
||||
@@ -191,6 +193,7 @@ def check_in_context(user, selected_date=None, form=None, sleep_form=None, activ
|
||||
sleep_check_in_by_date = {check_in.wake_up_date: check_in for check_in in sleep_check_ins}
|
||||
selected_check_in = check_in_by_date.get(selected_date)
|
||||
selected_sleep_check_in = sleep_check_in_by_date.get(selected_date)
|
||||
selected_dream = DreamEntry.objects.filter(user=user, wake_up_date=selected_date).first()
|
||||
|
||||
if form is None:
|
||||
form = NeckHeadacheCheckInForm(
|
||||
@@ -248,6 +251,7 @@ def check_in_context(user, selected_date=None, form=None, sleep_form=None, activ
|
||||
return {
|
||||
'check_in_form': form,
|
||||
'sleep_check_in_form': sleep_form,
|
||||
'selected_dream': selected_dream,
|
||||
'check_in_selected_date': selected_date,
|
||||
'check_in_today': today,
|
||||
'check_in_calendar_weeks': calendar_weeks,
|
||||
@@ -521,6 +525,7 @@ class TaskListView(LoginRequiredMixin, ListView):
|
||||
context.update(workout_context(self.request.user))
|
||||
context.update(brushing_context(self.request.user))
|
||||
context.update(hydration_context(self.request.user))
|
||||
context.update(daily_widget_context(self.request.user))
|
||||
context['gitea_activity_enabled'] = bool(settings.GITEA_USERNAME)
|
||||
profile, _ = UserSettings.objects.get_or_create(user=self.request.user)
|
||||
context['onboarding_tour'] = onboarding_context(profile)
|
||||
@@ -547,6 +552,7 @@ class HealthView(LoginRequiredMixin, TemplateView):
|
||||
))
|
||||
context.update(fasting_widget_context(self.request.user))
|
||||
context.update(hydration_context(self.request.user))
|
||||
context.update(daily_widget_context(self.request.user))
|
||||
return context
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user