diff --git a/Dockerfile b/Dockerfile index 7e62121..9ed59a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,11 +25,13 @@ RUN pip3 install -r /tmp/requirements.txt COPY patches/01_add_api_urls.patch /opt/venv/lib/python3.9/site-packages/ COPY patches/02_fix_allocation_denied_revoked_PR596.patch /opt/venv/lib/python3.9/site-packages/ COPY patches/03_add_active_needs_renewal_status.patch /opt/venv/lib/python3.9/site-packages/ +COPY patches/04_add_allocation_change_request_created_signal.patch /opt/venv/lib/python3.9/site-packages/ RUN cd /opt/venv/lib/python3.9/site-packages && \ patch -p1 < 01_add_api_urls.patch && \ patch -p1 < 02_fix_allocation_denied_revoked_PR596.patch && \ - patch -p1 < 03_add_active_needs_renewal_status.patch + patch -p1 < 03_add_active_needs_renewal_status.patch && \ + patch -p1 < 04_add_allocation_change_request_created_signal.patch # Final Image FROM python:3.9-slim-bullseye diff --git a/patches/04_add_allocation_change_request_created_signal.patch b/patches/04_add_allocation_change_request_created_signal.patch new file mode 100644 index 0000000..29eb3c7 --- /dev/null +++ b/patches/04_add_allocation_change_request_created_signal.patch @@ -0,0 +1,36 @@ +diff --git a/coldfront/core/allocation/signals.py b/coldfront/core/allocation/signals.py +index 1c078f0..51277b1 100644 +--- a/coldfront/core/allocation/signals.py ++++ b/coldfront/core/allocation/signals.py +@@ -14,3 +14,6 @@ allocation_remove_user = django.dispatch.Signal() + + allocation_change_approved = django.dispatch.Signal() + #providing_args=["allocation_pk", "allocation_change_pk"] ++ ++allocation_change_created = django.dispatch.Signal() ++ #providing_args=["allocation_pk", "allocation_change_pk"] +diff --git a/coldfront/core/allocation/views.py b/coldfront/core/allocation/views.py +index ec129fc..fa9b39c 100644 +--- a/coldfront/core/allocation/views.py ++++ b/coldfront/core/allocation/views.py +@@ -53,6 +53,7 @@ from coldfront.core.allocation.signals import (allocation_new, + allocation_activate_user, + allocation_disable, + allocation_remove_user, ++ allocation_change_created, + allocation_change_approved,) + from coldfront.core.allocation.utils import (generate_guauge_data_from_usage, + get_user_resources) +@@ -1811,6 +1812,12 @@ class AllocationChangeView(LoginRequiredMixin, UserPassesTestMixin, FormView): + + messages.success(request, 'Allocation change request successfully submitted.') + ++ allocation_change_created.send( ++ sender=self.__class__, ++ allocation_pk=allocation_obj.pk, ++ allocation_change_pk=allocation_change_request_obj.pk,) ++ ++ + send_allocation_admin_email(allocation_obj, + 'New Allocation Change Request', + 'email/new_allocation_change_request.txt',