Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion admin/collection_providers/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ def get_object(self, queryset=None):
return CollectionProvider.objects.get(id=self.kwargs['collection_provider_id'])


class CannotDeleteProvider(TemplateView):
class CannotDeleteProvider(PermissionRequiredMixin, TemplateView):
permission_required = 'osf.delete_collectionprovider'
raise_exception = True
template_name = 'collection_providers/cannot_delete.html'

def get_context_data(self, **kwargs):
Expand Down
4 changes: 3 additions & 1 deletion admin/institutions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,9 @@ def post(self, request, *args, **kwargs):
return redirect('institutions:detail', institution_id=institution.id)


class CannotDeleteInstitution(TemplateView):
class CannotDeleteInstitution(PermissionRequiredMixin, TemplateView):
permission_required = 'osf.delete_institution'
raise_exception = True
template_name = 'institutions/cannot_delete.html'

def get_context_data(self, **kwargs):
Expand Down
4 changes: 3 additions & 1 deletion admin/notifications/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,9 @@ def get_context_data(self, *args, **kwargs):
}


class NotificationCampaignCreateView(CreateView):
class NotificationCampaignCreateView(PermissionRequiredMixin, CreateView):
permission_required = 'osf.change_notificationcampaign'
raise_exception = True
model = NotificationCampaign
form_class = NotificationCampaignCreateForm
template_name = 'notifications/notification_campaing_create.html'
Expand Down
4 changes: 3 additions & 1 deletion admin/preprint_providers/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,9 @@ def get_object(self, queryset=None):
return PreprintProvider.objects.get(id=self.kwargs['preprint_provider_id'])


class CannotDeleteProvider(TemplateView):
class CannotDeleteProvider(PermissionRequiredMixin, TemplateView):
permission_required = 'osf.delete_preprintprovider'
raise_exception = True
template_name = 'preprint_providers/cannot_delete.html'

def get_context_data(self, **kwargs):
Expand Down
4 changes: 3 additions & 1 deletion admin/registration_providers/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ def get_context_data(self, *args, **kwargs):
return super().get_context_data(*args, **kwargs)


class CannotDeleteProvider(TemplateView):
class CannotDeleteProvider(PermissionRequiredMixin, TemplateView):
permission_required = 'osf.delete_registrationprovider'
raise_exception = True
template_name = 'registration_providers/cannot_delete.html'

def get_context_data(self, **kwargs):
Expand Down
Loading