aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-05-01 23:04:50 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-05-01 23:04:50 +0200
commitca103a5427f47eca4327a6165dac1981f9f1773f (patch)
tree4fc73b99e57265837051f7414e46ac0dd6e652c8
parentFixed a problem in a flash message. (diff)
downloadnewspipe-ca103a5427f47eca4327a6165dac1981f9f1773f.tar.gz
newspipe-ca103a5427f47eca4327a6165dac1981f9f1773f.tar.bz2
newspipe-ca103a5427f47eca4327a6165dac1981f9f1773f.zip
Bugfix: it was not possible to delete a user with categories.
-rw-r--r--src/web/models/user.py7
1 files changed, 5 insertions, 2 deletions
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'}
bgstack15