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

Easier way to add volunteer role admins #1534

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ormiret
Copy link
Contributor

@ormiret ormiret commented May 14, 2024

fixes #1508

@jellybob jellybob force-pushed the vol_role_admin_setting branch from 743d0c1 to 09569c5 Compare May 15, 2024 20:52
@jellybob
Copy link
Contributor

Rebased, and regenerated the migration.

I'm seeing the following warnings on startup, and don't know enough SQLAlchemy (or have enough brain power this evening) to work out whether they're something we should be worrying about.

/app/models/__init__.py:202: SAWarning: relationship 'Role.role_admins' will copy column volunteer_role.id to column volunteer_role_admin.role_id, which conflicts with relationship(s): 'Role.admins' (copies volunteer_role.id to volunteer_role_admin.role_id), 'RoleAdmin.role' (copies volunteer_role.id to volunteer_role_admin.role_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="admins,role"' to the 'Role.role_admins' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
  db.configure_mappers()
/app/models/__init__.py:202: SAWarning: relationship 'Role.role_admins' will copy column volunteer.user_id to column volunteer_role_admin.user_id, which conflicts with relationship(s): 'RoleAdmin.user' (copies user.id to volunteer_role_admin.user_id), 'User.volunteer_admin_roles' (copies user.id to volunteer_role_admin.user_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="user,volunteer_admin_roles"' to the 'Role.role_admins' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
  db.configure_mappers()
/app/models/__init__.py:202: SAWarning: relationship 'Volunteer.admined_roles' will copy column volunteer.user_id to column volunteer_role_admin.user_id, which conflicts with relationship(s): 'RoleAdmin.user' (copies user.id to volunteer_role_admin.user_id), 'User.volunteer_admin_roles' (copies user.id to volunteer_role_admin.user_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="user,volunteer_admin_roles"' to the 'Volunteer.admined_roles' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
  db.configure_mappers()
/app/models/__init__.py:202: SAWarning: relationship 'Volunteer.admined_roles' will copy column volunteer_role.id to column volunteer_role_admin.role_id, which conflicts with relationship(s): 'Role.admins' (copies volunteer_role.id to volunteer_role_admin.role_id), 'RoleAdmin.role' (copies volunteer_role.id to volunteer_role_admin.role_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="admins,role"' to the 'Volunteer.admined_roles' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)

@marksteward marksteward self-assigned this May 17, 2024
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.

Make assigning role admins less painful
3 participants