This pull request includes changes to enhance timezone handling in views and improve the filtering logic for push notifications in the notifications/utils.py file. The most important changes include adding a new TimezoneMixin and updating the views to use this mixin, as well as refining the filtering of push notifications based on user preferences.
Enhancements to timezone handling:
hub/views/fast.py: Added TimezoneMixin to the FastListView, FastDetailView, and FastByDateView classes to provide timezone context for serializers. Removed redundant methods for getting timezone from these views. [1][2][3][4][5][6][7]
hub/views/mixins.py: Introduced the TimezoneMixin class to handle timezone context for serializers, expecting a 'tz' query parameter in IANA format. [1][2]
Improvements to push notification filtering:
notifications/utils.py: Enhanced the filtering logic for push notifications to consider user preferences more accurately. Added checks for notification_type and refined exclusion conditions for weekly fasts.
Fixes #96
This pull request includes changes to enhance timezone handling in views and improve the filtering logic for push notifications in the
notifications/utils.py
file. The most important changes include adding a newTimezoneMixin
and updating the views to use this mixin, as well as refining the filtering of push notifications based on user preferences.Enhancements to timezone handling:
hub/views/fast.py
: AddedTimezoneMixin
to theFastListView
,FastDetailView
, andFastByDateView
classes to provide timezone context for serializers. Removed redundant methods for getting timezone from these views. [1] [2] [3] [4] [5] [6] [7]hub/views/mixins.py
: Introduced theTimezoneMixin
class to handle timezone context for serializers, expecting a 'tz' query parameter in IANA format. [1] [2]Improvements to push notification filtering:
notifications/utils.py
: Enhanced the filtering logic for push notifications to consider user preferences more accurately. Added checks fornotification_type
and refined exclusion conditions for weekly fasts.