Merge branch 'workaround-357' into 'master'
bugfix: clearing user cache on Notification update See merge request djangoldp-packages/djangoldp-notification!41
This commit is contained in:
commit
15c53461f2
@ -1,3 +1,4 @@
|
|||||||
|
from djangoldp.serializers import LDPSerializer
|
||||||
from djangoldp.views import LDPViewSet
|
from djangoldp.views import LDPViewSet
|
||||||
from djangoldp.pagination import LDPPagination
|
from djangoldp.pagination import LDPPagination
|
||||||
|
|
||||||
@ -10,3 +11,10 @@ class LDPNotificationsViewSet(LDPViewSet):
|
|||||||
'''overridden LDPViewSet to force pagination'''
|
'''overridden LDPViewSet to force pagination'''
|
||||||
pagination_class = LDPNotificationsPagination
|
pagination_class = LDPNotificationsPagination
|
||||||
depth = 0
|
depth = 0
|
||||||
|
|
||||||
|
def update(self, request, *args, **kwargs):
|
||||||
|
instance = self.get_object()
|
||||||
|
|
||||||
|
LDPSerializer.to_representation_cache.invalidate(instance.user.urlid)
|
||||||
|
|
||||||
|
return super().update(request, *args, **kwargs)
|
||||||
|
Loading…
Reference in New Issue
Block a user