mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-29 17:42:12 +08:00
Correct types in UserRoleAssociation (optional/nullable)
This commit is contained in:
@@ -3597,13 +3597,13 @@ class UserRoleAssociation(Base, RepresentById):
|
||||
__tablename__ = "user_role_association"
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True)
|
||||
role_id: Mapped[Optional[int]] = mapped_column(ForeignKey("role.id"), index=True)
|
||||
user_id: Mapped[int] = mapped_column(ForeignKey("galaxy_user.id"), index=True, nullable=True)
|
||||
role_id: Mapped[int] = mapped_column(ForeignKey("role.id"), index=True, nullable=True)
|
||||
create_time: Mapped[datetime] = mapped_column(default=now, nullable=True)
|
||||
update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True)
|
||||
|
||||
user: Mapped[Optional["User"]] = relationship(back_populates="roles")
|
||||
role: Mapped[Optional["Role"]] = relationship(back_populates="users")
|
||||
user: Mapped["User"] = relationship(back_populates="roles")
|
||||
role: Mapped["Role"] = relationship(back_populates="users")
|
||||
|
||||
def __init__(self, user, role):
|
||||
add_object_to_object_session(self, user)
|
||||
|
||||
Reference in New Issue
Block a user