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.
Projects can reference catalogs that are not available to the current user.
This can occur in the following cases:
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
to
ProjectSerializerandto the
Projectmodel, analogous tocatalog_uri.Use these attributes for displaying the catalog information in the frontend.