test docu, non fonctionnel pour l'instant
CI - Security, Lint & Tests / validate (push) Failing after 1m7s
CI - Security, Lint & Tests / validate (push) Failing after 1m7s
This commit is contained in:
@@ -84,7 +84,7 @@ class Document(db.Model):
|
|||||||
)
|
)
|
||||||
assignments = db.relationship(
|
assignments = db.relationship(
|
||||||
'DocumentAssignment',
|
'DocumentAssignment',
|
||||||
backref='assigned_document',
|
back_populates='document',
|
||||||
lazy='dynamic',
|
lazy='dynamic',
|
||||||
order_by='DocumentAssignment.created_at',
|
order_by='DocumentAssignment.created_at',
|
||||||
foreign_keys='DocumentAssignment.document_id',
|
foreign_keys='DocumentAssignment.document_id',
|
||||||
@@ -161,7 +161,7 @@ class DocumentAssignment(db.Model):
|
|||||||
filed_team_id = db.Column(db.Integer, db.ForeignKey('org_teams.id'), nullable=True)
|
filed_team_id = db.Column(db.Integer, db.ForeignKey('org_teams.id'), nullable=True)
|
||||||
created_at = db.Column(db.DateTime, default=utc_now_naive)
|
created_at = db.Column(db.DateTime, default=utc_now_naive)
|
||||||
|
|
||||||
document = db.relationship('Document', foreign_keys=[document_id])
|
document = db.relationship('Document', back_populates='assignments', foreign_keys=[document_id])
|
||||||
user = db.relationship('User', foreign_keys=[user_id], backref='document_assignments')
|
user = db.relationship('User', foreign_keys=[user_id], backref='document_assignments')
|
||||||
completed_version = db.relationship('DocumentVersion', foreign_keys=[completed_version_id])
|
completed_version = db.relationship('DocumentVersion', foreign_keys=[completed_version_id])
|
||||||
filed_team = db.relationship('OrgTeam', foreign_keys=[filed_team_id])
|
filed_team = db.relationship('OrgTeam', foreign_keys=[filed_team_id])
|
||||||
|
|||||||
@@ -32,14 +32,14 @@ def user_org_team_ids(user):
|
|||||||
relationships (many-to-many *and* legacy single column) for staff. An
|
relationships (many-to-many *and* legacy single column) for staff. An
|
||||||
admin or a scout belongs to none, regardless of how many teams exist.
|
admin or a scout belongs to none, regardless of how many teams exist.
|
||||||
"""
|
"""
|
||||||
from app.permissions import coach_org_team_ids, manager_org_team_ids
|
from app.permissions import coach_org_teams, manager_org_teams
|
||||||
|
|
||||||
if isinstance(user, Player):
|
if isinstance(user, Player):
|
||||||
return [tp.org_team_id for tp in user.team_placements]
|
return [tp.org_team_id for tp in user.team_placements]
|
||||||
if isinstance(user, Coach):
|
if isinstance(user, Coach):
|
||||||
return coach_org_team_ids(user)
|
return [team.id for team in coach_org_teams(user)]
|
||||||
if isinstance(user, Manager):
|
if isinstance(user, Manager):
|
||||||
return manager_org_team_ids(user)
|
return [team.id for team in manager_org_teams(user)]
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user