Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: signal handlers sync project views and tasks #1218

Draft
wants to merge 1 commit into
base: 2.3.0
Choose a base branch
from

Conversation

MyPyDavid
Copy link
Member

@MyPyDavid MyPyDavid commented Dec 19, 2024

Description

For the settings this PR removes:
PROJECT_REMOVE_VIEWS = True
and adds:

PROJECT_VIEWS_SYNC = True
PROJECT_TASKS_SYNC = True

The projects/handlers.py are refactored into a project/handlers package with a project/handlers/generic_handlers.py module that contains the logic for signal receivers.
It handles the signals for changes in View.catalogs, View.sites, View.groups as well as Task.catalogs, Task.sites, Task.groups and updates the project.views or projects.tasks.

Tests, that only use db view.catalog.add(...) methods and not the client, are included.

Related issues: #966, #1198, #345, #431

Motivation and Context

How has this been tested?

Screenshots (if appropriate)

@MyPyDavid MyPyDavid self-assigned this Dec 19, 2024
@MyPyDavid MyPyDavid changed the base branch from main to 2.3.0 December 19, 2024 18:34
@MyPyDavid MyPyDavid force-pushed the feat-sync-project-views-and-tasks branch from 15fd305 to d708437 Compare January 7, 2025 17:05
@MyPyDavid MyPyDavid force-pushed the feat-sync-project-views-and-tasks branch from d708437 to 9065876 Compare January 8, 2025 09:54
@MyPyDavid MyPyDavid added this to the RDMO 2.3.0 milestone Jan 8, 2025
from rdmo.projects.models import Project
from rdmo.tasks.models import Task

from .helpers import assert_other_projects_unchanged
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this. We should stick to helpers for tests (and use sparingly) and utils for regular code.

@@ -0,0 +1,10 @@

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think those methods should exist, this should be inline in the handlers (and without the getattr).

rdmo/projects/handlers/generic_handlers.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants