Skip to content

Handle unavailable catalogs in projects in RDMO 3.0.0 #1708

Description

@CalamityC

Projects can reference catalogs that are not available to the current user.

This can occur in the following cases:

  • Cross-site projects: In a multi-site setup, a project can be viewed from a site other than the one it was created in. Catalogs attached to the project may not be available on the site from which the project is being viewed.
  • Deactivated catalogs: A catalog from the same site may have been deactivated. Administrators can still access deactivated catalogs, but for regular users they are not accessible.

Currently, these cases are not handled correctly when displaying a project (in 3.0.0). Projects should therefore be able to handle references to catalogs that are unavailable to the current user.

Proposed solution

Add

'catalog_title',
'catalog_help',

to ProjectSerializer and

@property
def catalog_title(self) -> str | None:
    if self.catalog is not None:
        return self.catalog.title

@property
def catalog_help(self) -> str | None:
    if self.catalog is not None:
        return self.catalog.help

to the Project model, analogous to catalog_uri.

Use these attributes for displaying the catalog information in the frontend.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions