diff --git a/.dockerignore b/.dockerignore index 1eb63a0d..fafd3396 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,6 +8,7 @@ !dejacode/ !dejacode_toolkit/ !dje/ +!internal_notifications/ !license_library/ !notification/ !organization/ diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7ea91f3f..bc8fd303 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,12 @@ Release notes ============= +### Version 6.1.0 + +**Upgrade prerequisite:** upgrade to DejaCode 6.0.x and run its migrations before upgrading to this version. The internal notifications app replaces the django-notifications-patched dependency and requires the 6.0.x database schema. + +This release removes unused columns from the notifications table: back up the database before upgrading, as a rollback to an earlier version requires a database restore. + ### Version 6.0.1 * fix: relink cloned codebase resources to the cloned inventory #601 by @tdruez in https://github.com/aboutcode-org/dejacode/pull/602 diff --git a/MANIFEST.in b/MANIFEST.in index aea848c4..579465d2 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -19,6 +19,7 @@ graft dejacode_toolkit graft dje graft docs graft etc +graft internal_notifications graft license_library graft notification graft organization diff --git a/component_catalog/tests/test_views.py b/component_catalog/tests/test_views.py index 186b72de..a621b8bd 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 @@ -59,6 +58,7 @@ from dje.tests import create_superuser from dje.tests import create_user from dje.views import PaginationMixin +from internal_notifications.models import Notification from license_library.models import License from license_library.models import LicenseAssignedTag from license_library.models import LicenseTag diff --git a/compose.dev.yml b/compose.dev.yml index 835bc9e5..67508ed8 100644 --- a/compose.dev.yml +++ b/compose.dev.yml @@ -41,6 +41,7 @@ services: - ./dejacode:/opt/dejacode/dejacode - ./dejacode_toolkit:/opt/dejacode/dejacode_toolkit - ./dje:/opt/dejacode/dje + - ./internal_notifications:/opt/dejacode/internal_notifications - ./license_library:/opt/dejacode/license_library - ./notification:/opt/dejacode/notification - ./organization:/opt/dejacode/organization diff --git a/dejacode/settings.py b/dejacode/settings.py index fc8abda2..a6f2162b 100644 --- a/dejacode/settings.py +++ b/dejacode/settings.py @@ -329,7 +329,6 @@ def gettext_noop(s): "crispy_bootstrap5", "guardian", "django_filters", - "notifications", "axes", "django_otp", "django_otp.plugins.otp_totp", @@ -346,6 +345,7 @@ def gettext_noop(s): "purldb", "policy", "notification", + "internal_notifications", "vulnerabilities", "vulnerabilities.triage", ] diff --git a/dje/models.py b/dje/models.py index 7c19488a..cbd3d7ab 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 internal_notifications.models import Notification logger = logging.getLogger("dje") @@ -1881,7 +1880,7 @@ def serialize_hook(self, hook): } def send_internal_notification(self, verb, **data): - """Similar to ``notify.send`` without relying on the Signal system.""" + """Create an internal Notification sent by and to this user.""" return Notification.objects.create( recipient=self, actor=self, 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 %}