Changeset View
Changeset View
Standalone View
Standalone View
users/views/api.py
| """API for notification.""" | """API for notification.""" | ||||
| from django.contrib.auth.mixins import LoginRequiredMixin | from django.contrib.auth.mixins import LoginRequiredMixin | ||||
| from django.http import HttpResponseForbidden | from django.http import HttpResponseForbidden | ||||
| from django.http.response import JsonResponse | from django.http.response import JsonResponse | ||||
| from django.utils import timezone | |||||
| from django.views import View | from django.views import View | ||||
| from django.views.generic.detail import SingleObjectMixin | from django.views.generic.detail import SingleObjectMixin | ||||
| from django.utils import timezone | from django.contrib.auth import get_user_model | ||||
| from users.models import Notification | from users.models import Notification | ||||
| User = get_user_model() | |||||
| class NotificationMarkReadView(LoginRequiredMixin, SingleObjectMixin, View): | class NotificationMarkReadView(LoginRequiredMixin, SingleObjectMixin, View): | ||||
| """Allow users to mark specific notifications as read.""" | """Allow users to mark specific notifications as read.""" | ||||
| raise_exception = True | raise_exception = True | ||||
| model = Notification | model = Notification | ||||
| Show All 28 Lines | |||||