8000 Institution feature implementation. by co505 · Pull Request #670 · ubccr/coldfront · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Institution feature implementation. #670

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

co505
Copy link
@co505 co505 commented Apr 2, 2025

Overview

Implemented project institution feature, enabling sites with multiple institutions to easily identify which project belongs to which institution. This feature automates institution assignment based on the PI's email address.

Changes Made

  • models.py - Added institution attribute into the Project class.
  • core.py - Added environment variable, PROJECT_INSTITUTION_EMAIL_MAP.
  • view.py - Implemented logic into form_valid function to handle institution assignment.
  • /templates - project_detail, project_list, project_archived_list altered to show institution from GUI.
  • tests.py - Tests added for institution feature.
  • config.md - Added basic documentation to describe PROJECT_INSTITUTION_EMAIL_MAP
  • admin.md - Overhauled get_list_display to add multiple dynamic columns into list_display, therefore showing institution and project_code alongside one another.
  • /migrations - Migration file added.
  • /management - Management commands added to retrospectively assign institution codes to preexisting projects, --dry-run option included too.

Examples*

Feature uses PROJECT_INSTITUTION_EMAIL_MAP to check the PIs email address against a dictionary of key-value pairs, set by the user. e.g. PROJECT_INSTITUTION_EMAIL_MAP=cardiff.ac.uk=CDF,bangor.ac.uk=BGR,swansea.ac.uk=SWAN

If PIs email matches a key, the value will be stored into the database.

The screenshots below use a cardiff.ac.uk email address and make the CDF institution available in the GUI.

project_list

image

project_detail

image

Project Admin Panel

image

@co505
Copy link
Author
co505 commented Apr 30, 2025

@aebruno Overhauled this slightly, it's now finalised and ready for review. Thanks :)

@co505 co505 force-pushed the institutions_refactor branch 4 times, most recently from 60064d8 to 964bef3 Compare May 2, 2025 13:08
Signed-off-by: Connor Brock <BrockC2@cardiff.ac.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0