diff --git a/Dockerfile b/Dockerfile index d5dce5b303a..31fcb8ccbec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,7 +54,9 @@ RUN set -ex \ WORKDIR /code # Policies -ADD https://github.com/CenterForOpenScience/cos.io.git#master ./COS_POLICIES/ +RUN git clone https://github.com/CenterForOpenScience/cos.io.git ./COS_POLICIES/ +# When Jenkins uses a newer docker: +# ADD https://github.com/CenterForOpenScience/cos.io.git#master ./COS_POLICIES/ COPY pyproject.toml . COPY poetry.lock . diff --git a/admin/nodes/urls.py b/admin/nodes/urls.py index 5036b9dd06d..d081b544d61 100644 --- a/admin/nodes/urls.py +++ b/admin/nodes/urls.py @@ -38,4 +38,5 @@ re_path(r'^(?P[a-z0-9]+)/make_private/$', views.NodeMakePrivate.as_view(), name='make-private'), re_path(r'^(?P[a-z0-9]+)/make_public/$', views.NodeMakePublic.as_view(), name='make-public'), re_path(r'^(?P[a-z0-9]+)/remove_notifications/$', views.NodeRemoveNotificationView.as_view(), name='node-remove-notifications'), + re_path(r'^(?P[a-z0-9]+)/update_moderation_state/$', views.NodeUpdateModerationStateView.as_view(), name='node-update-mod-state'), ] diff --git a/admin/nodes/views.py b/admin/nodes/views.py index 74b6b08feae..f1e90d72c09 100644 --- a/admin/nodes/views.py +++ b/admin/nodes/views.py @@ -118,6 +118,17 @@ def post(self, request, *args, **kwargs): return redirect('nodes:node', guid=kwargs.get('guid')) + +class NodeUpdateModerationStateView(View): + def post(self, request, *args, **kwargs): + guid = kwargs.get('guid') + node = AbstractNode.load(guid) + node.update_moderation_state() + messages.success(request, 'Moderation state successfully updated.') + + return redirect('nodes:node', guid=kwargs.get('guid')) + + class NodeSearchView(PermissionRequiredMixin, FormView): """ Allows authorized users to search for a node by it's guid. """ diff --git a/admin/templates/nodes/node.html b/admin/templates/nodes/node.html index 6ec71e2dfdc..cb12f49c375 100644 --- a/admin/templates/nodes/node.html +++ b/admin/templates/nodes/node.html @@ -64,7 +64,12 @@

{{ node.type|cut:'osf.'|title }}: {{ node.title }} + {% csrf_token %} + + + Creator