MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / get_is_dismissed

Method get_is_dismissed

core/serializers.py:167–172  ·  view source on GitHub ↗

Check if the current user has dismissed this notification.

(self, obj)

Source from the content-addressed store, hash-verified

165 read_only_fields = ['created_at']
166
167 def get_is_dismissed(self, obj):
168 """Check if the current user has dismissed this notification."""
169 request = self.context.get('request')
170 if request and request.user.is_authenticated:
171 return obj.dismissals.filter(user=request.user).exists()
172 return False
173
174
175class NotificationDismissalSerializer(serializers.ModelSerializer):

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
existsMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected