aboutsummaryrefslogtreecommitdiff
path: root/src/web/controllers/user.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2020-02-26 11:27:31 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2020-02-26 11:27:31 +0100
commit62b3afeeedfe054345f86093e2d243e956c1e3c9 (patch)
treebbd58f5c8c07f5d87b1c1cca73fa1d5af6178f48 /src/web/controllers/user.py
parentUpdated Python dependencies. (diff)
downloadnewspipe-62b3afeeedfe054345f86093e2d243e956c1e3c9.tar.gz
newspipe-62b3afeeedfe054345f86093e2d243e956c1e3c9.tar.bz2
newspipe-62b3afeeedfe054345f86093e2d243e956c1e3c9.zip
The project is now using Poetry.
Diffstat (limited to 'src/web/controllers/user.py')
-rw-r--r--src/web/controllers/user.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/web/controllers/user.py b/src/web/controllers/user.py
deleted file mode 100644
index 6ab04d44..00000000
--- a/src/web/controllers/user.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import logging
-from werkzeug.security import generate_password_hash, check_password_hash
-from .abstract import AbstractController
-from web.models import User
-
-logger = logging.getLogger(__name__)
-
-
-class UserController(AbstractController):
- _db_cls = User
- _user_id_key = 'id'
-
- def _handle_password(self, attrs):
- if attrs.get('password'):
- attrs['pwdhash'] = generate_password_hash(attrs.pop('password'))
- elif 'password' in attrs:
- del attrs['password']
-
- def check_password(self, user, password):
- return check_password_hash(user.pwdhash, password)
-
- def create(self, **attrs):
- self._handle_password(attrs)
- return super().create(**attrs)
-
- def update(self, filters, attrs):
- self._handle_password(attrs)
- return super().update(filters, attrs)
bgstack15