From f4e408e99923bd9d0e9d03cbbb724a9a3dcc2994 Mon Sep 17 00:00:00 2001 From: tdruez Date: Mon, 2 Nov 2026 16:28:50 +0400 Subject: [PATCH 1/6] chore: replace django-notifications-patched with an internal notifications app Signed-off-by: tdruez --- .dockerignore | 1 + MANIFEST.in | 1 + component_catalog/tests/test_views.py | 2 +- compose.dev.yml | 1 + dje/models.py | 3 +- .../navbar/navbar_header_right_menu.html | 3 +- .../notifications/notice_content.html | 5 +- dje/tests/test_views.py | 22 ++- dje/views.py | 24 +-- etc/scripts/build_deb_docker.py | 9 +- etc/scripts/build_rpm_docker.py | 12 +- notifications/__init__.py | 7 + notifications/apps.py | 15 ++ ...009_alter_notification_options_and_more.py | 157 ++++++++++++++++++ .../migrations/0002_remove_unused_fields.py | 38 +++++ notifications/migrations/__init__.py | 0 notifications/models.py | 78 +++++++++ notifications/tests/__init__.py | 0 notifications/tests/test_models.py | 65 ++++++++ product_portfolio/tests/test_tasks.py | 2 +- product_portfolio/tests/test_views.py | 2 +- pyproject.toml | 4 - .../django-notifications-patched-2.0.0.tar.gz | Bin 33450 -> 0 bytes .../dist/jsonfield-3.2.0-py3-none-any.whl | Bin 8316 -> 0 bytes .../jsonfield-3.2.0-py3-none-any.whl.ABOUT | 13 -- .../dist/swapper-1.5.0-py2.py3-none-any.whl | Bin 7273 -> 0 bytes uv.lock | 36 ---- vulnerabilities/tests/test_fetch.py | 3 +- workflow/notification.py | 15 +- workflow/tests/test_views.py | 2 +- 30 files changed, 414 insertions(+), 106 deletions(-) create mode 100644 notifications/__init__.py create mode 100644 notifications/apps.py create mode 100644 notifications/migrations/0001_squashed_0009_alter_notification_options_and_more.py create mode 100644 notifications/migrations/0002_remove_unused_fields.py create mode 100644 notifications/migrations/__init__.py create mode 100644 notifications/models.py create mode 100644 notifications/tests/__init__.py create mode 100644 notifications/tests/test_models.py delete mode 100644 thirdparty/dist/django-notifications-patched-2.0.0.tar.gz delete mode 100644 thirdparty/dist/jsonfield-3.2.0-py3-none-any.whl delete mode 100644 thirdparty/dist/jsonfield-3.2.0-py3-none-any.whl.ABOUT delete mode 100644 thirdparty/dist/swapper-1.5.0-py2.py3-none-any.whl diff --git a/.dockerignore b/.dockerignore index 1eb63a0d..2e1e336a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -10,6 +10,7 @@ !dje/ !license_library/ !notification/ +!notifications/ !organization/ !policy/ !product_portfolio/ diff --git a/MANIFEST.in b/MANIFEST.in index aea848c4..9bae1949 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -21,6 +21,7 @@ graft docs graft etc graft license_library graft notification +graft notifications graft organization graft policy graft product_portfolio diff --git a/component_catalog/tests/test_views.py b/component_catalog/tests/test_views.py index 186b72de..2940f9d7 100644 --- a/component_catalog/tests/test_views.py +++ b/component_catalog/tests/test_views.py @@ -26,7 +26,6 @@ from django.utils.encoding import force_str from guardian.shortcuts import assign_perm -from notifications.models import Notification from component_catalog.forms import ComponentAddToProductForm from component_catalog.forms import ComponentForm @@ -64,6 +63,7 @@ from license_library.models import LicenseTag from license_library.models import LicenseTagGroup from license_library.models import LicenseTagGroupAssignedTag +from notifications.models import Notification from organization.models import Owner from organization.models import Subowner from policy.models import UsagePolicy diff --git a/compose.dev.yml b/compose.dev.yml index 835bc9e5..c33f6ba0 100644 --- a/compose.dev.yml +++ b/compose.dev.yml @@ -43,6 +43,7 @@ services: - ./dje:/opt/dejacode/dje - ./license_library:/opt/dejacode/license_library - ./notification:/opt/dejacode/notification + - ./notifications:/opt/dejacode/notifications - ./organization:/opt/dejacode/organization - ./policy:/opt/dejacode/policy - ./product_portfolio:/opt/dejacode/product_portfolio diff --git a/dje/models.py b/dje/models.py index 7c19488a..e94bbcbc 100644 --- a/dje/models.py +++ b/dje/models.py @@ -46,11 +46,10 @@ from django.utils.text import format_lazy from django.utils.translation import gettext_lazy as _ -from notifications.models import Notification - from aboutcode.api_auth import AbstractAPIToken from dje.fields import LastModifiedByField from dje.tasks import send_mail_task +from notifications.models import Notification logger = logging.getLogger("dje") diff --git a/dje/templates/navbar/navbar_header_right_menu.html b/dje/templates/navbar/navbar_header_right_menu.html index 71593b16..4c6fb262 100644 --- a/dje/templates/navbar/navbar_header_right_menu.html +++ b/dje/templates/navbar/navbar_header_right_menu.html @@ -1,5 +1,4 @@ {% load i18n static %} -{% load has_notification from notifications_tags %} {% block right-nav %}