Aug 4 - Update code to follow up - MT13b
This commit is contained in:
+7
-1
@@ -43,7 +43,13 @@ class User(UserMixin, db.Model):
|
||||
mfa_recovery_codes = db.Column(db.JSON, nullable=True)
|
||||
|
||||
# Relationships
|
||||
inspections = db.relationship('Inspection', backref='inspector', lazy='dynamic')
|
||||
# phase49: inspections now has TWO foreign keys to users.id — inspector_id
|
||||
# and follow_up_requested_by — so the join is otherwise ambiguous and every
|
||||
# mapper configuration fails with AmbiguousForeignKeysError. This
|
||||
# relationship means "inspections I performed": inspector_id only.
|
||||
inspections = db.relationship('Inspection', backref='inspector',
|
||||
lazy='dynamic',
|
||||
foreign_keys='Inspection.inspector_id')
|
||||
|
||||
# ── Flask-Login integration ────────────────────────────────────────────
|
||||
# Override UserMixin.is_active so that disabled accounts are rejected
|
||||
|
||||
Reference in New Issue
Block a user