Skip to content

refactor: deprecated v2 preferences api and its dependencies #60

@AhtishamShahid

Description

@AhtishamShahid

Ticket : openedx/openedx-platform#37947

This pull request refactors and simplifies the notification preferences system in the openedx/core/djangoapps/notifications module. It removes the NotificationTypeManager and NotificationAppManager classes, consolidates logic for retrieving notification preferences, and updates related documentation and function usage. The main goal is to streamline how default notification preferences are accessed and managed, reducing complexity and improving maintainability.

Key changes include:

Refactoring and Simplification:

  • Remove v2/configurations notifications API
  • Removed the NotificationTypeManager and NotificationAppManager classes, along with their methods for managing notification types and preferences, in favor of a simpler, function-based approach.
  • Deleted the get_default_values_of_preference function and replaced its usage with the more general get_default_values_of_preferences function throughout the codebase.
    Documentation and Naming Updates:
  • Updated docstrings and comments to clarify that use_app_defaults replaces the previous concept of "core" notifications, improving terminology and developer understanding.
    Code Cleanup:
  • Removed the unused get_non_editable_channels function from the serializers, further reducing unnecessary code.
  • Cleaned up test imports by removing references to deleted classes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions