rdmorganiser / rdmorganiser/rdmo
Handle unavailable catalogs in projects in RDMO 3.0.0
Open
- Dominant language
- Python
- Stars
- 133
- Forks
- 60
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 21
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.