forked from gergely/calendar-social
Make User.profile a single object instead of a list
Because it’s a one-to-one relationship anyway, what’s the use of lists here?
This commit is contained in:
@@ -167,7 +167,7 @@ class Profile(db.Model): # pylint: disable=too-few-public-methods
|
||||
#: The ID of the local user this profile belongs to
|
||||
user_id = db.Column(db.Integer(), db.ForeignKey('users.id'), nullable=True, unique=True)
|
||||
|
||||
user = db.relationship(User, backref=db.backref('profile', lazy='dynamic'))
|
||||
user = db.relationship(User, backref=db.backref('profile', uselist=False))
|
||||
|
||||
#: The username this profile belongs to. If ``None``, `user_id` must be set
|
||||
username = db.Column(db.String(length=50), nullable=True)
|
||||
|
Reference in New Issue
Block a user