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

Add support for multiple affiliations #8

Merged
merged 27 commits into from
Mar 15, 2024

Conversation

duartegalvao
Copy link
Member

@duartegalvao duartegalvao commented Dec 20, 2023

Depends on indico/indico#6102
This PR adds support for multiple affiliations for authors in abstracts&contributions.

image-1
image-2
image-3
image-4

@duartegalvao duartegalvao force-pushed the multiple-affiliations branch 4 times, most recently from 16e5e8e to f830c86 Compare January 11, 2024 13:16
Comment on lines +89 to +136
person_link.jacow_affiliations = []
db.session.flush()
person_link.jacow_affiliations = [affiliations_cls(affiliation_id=id, display_order=i)
Copy link
Member Author

@duartegalvao duartegalvao Jan 12, 2024

Choose a reason for hiding this comment

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

this is quite ugly but it's a workaround for an error related to the unique constraint i put on (person_link_id, display_order). should I get rid of that constraint altogether? or is there a better fix for this

Copy link
Member

Choose a reason for hiding this comment

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

i think it;s fine. there's no other data referencing the jacow affiliations so no problem w/ recreating them while saving. it's all in a transaction anyway

@duartegalvao duartegalvao force-pushed the multiple-affiliations branch from b7404b7 to 56f4b34 Compare January 12, 2024 13:40
@duartegalvao duartegalvao changed the title [WIP] Add support for multiple affiliations Add support for multiple affiliations Jan 12, 2024
@duartegalvao duartegalvao marked this pull request as ready for review January 12, 2024 13:41
@duartegalvao duartegalvao force-pushed the multiple-affiliations branch from 33b5a6c to a6e37c1 Compare February 6, 2024 09:48
@ThiefMaster ThiefMaster force-pushed the multiple-affiliations branch 2 times, most recently from ac22d4a to 3ad6a58 Compare February 8, 2024 16:41
Copy link
Member

@ThiefMaster ThiefMaster left a comment

Choose a reason for hiding this comment

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

note: i rebased and fixed the linter issues

indico_jacow/models/affiliations.py Outdated Show resolved Hide resolved
indico_jacow/plugin.py Outdated Show resolved Hide resolved
indico_jacow/controllers.py Outdated Show resolved Hide resolved
indico_jacow/client/MultipleAffiliationsSelector.jsx Outdated Show resolved Hide resolved
@duartegalvao duartegalvao force-pushed the multiple-affiliations branch 2 times, most recently from 2011004 to f47f18a Compare February 16, 2024 13:16
@ThiefMaster ThiefMaster force-pushed the multiple-affiliations branch from f47f18a to 251379e Compare March 13, 2024 11:04
@ThiefMaster ThiefMaster enabled auto-merge (squash) March 15, 2024 15:13
@ThiefMaster ThiefMaster merged commit 5a9dd49 into indico:master Mar 15, 2024
3 checks passed
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.

2 participants