From ca103a5427f47eca4327a6165dac1981f9f1773f Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sun, 1 May 2016 23:04:50 +0200 Subject: Bugfix: it was not possible to delete a user with categories. --- src/web/models/user.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/web/models/user.py b/src/web/models/user.py index 96556b98..08279c7e 100644 --- a/src/web/models/user.py +++ b/src/web/models/user.py @@ -47,8 +47,6 @@ class User(db.Model, UserMixin, RightMixin): pwdhash = db.Column(db.String()) date_created = db.Column(db.DateTime(), default=datetime.now) last_seen = db.Column(db.DateTime(), default=datetime.now) - feeds = db.relationship('Feed', backref='subscriber', lazy='dynamic', - cascade='all,delete-orphan') refresh_rate = db.Column(db.Integer, default=60) # in minutes # user rights @@ -56,6 +54,11 @@ class User(db.Model, UserMixin, RightMixin): is_admin = db.Column(db.Boolean(), default=False) is_api = db.Column(db.Boolean(), default=False) + # relationship + feeds = db.relationship('Feed', backref='subscriber', lazy='dynamic', + cascade='all,delete-orphan') + categories = db.relationship('Category', cascade='all, delete-orphan') + @staticmethod def _fields_base_write(): return {'login', 'password', 'email'} -- cgit