aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2015-04-12 22:14:08 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2015-04-12 22:14:08 +0200
commit78dc3babe59f94a7af11493d84a3dda067995ef3 (patch)
tree83193f4337ba44f4e64f8b631cdf7eb9cb35c07f
parentFixed a bug when creating a new user via the dashboard. An other little impro... (diff)
downloadnewspipe-78dc3babe59f94a7af11493d84a3dda067995ef3.tar.gz
newspipe-78dc3babe59f94a7af11493d84a3dda067995ef3.tar.bz2
newspipe-78dc3babe59f94a7af11493d84a3dda067995ef3.zip
Removed useless form instance.
-rw-r--r--pyaggr3g470r/views/views.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/pyaggr3g470r/views/views.py b/pyaggr3g470r/views/views.py
index 577ae59d..09bb920e 100644
--- a/pyaggr3g470r/views/views.py
+++ b/pyaggr3g470r/views/views.py
@@ -535,12 +535,11 @@ def management():
else:
flash(gettext('File not allowed.'), 'danger')
- form = AddFeedForm()
nb_feeds = len(g.user.feeds.all())
articles = Article.query.filter(Article.user_id == g.user.id)
nb_articles = articles.count()
nb_unread_articles = articles.filter(Article.readed == False).count()
- return render_template('management.html', user=g.user, form=form,
+ return render_template('management.html', user=g.user,
nb_feeds=nb_feeds, nb_articles=nb_articles,
nb_unread_articles=nb_unread_articles)
@@ -690,7 +689,6 @@ def create_user(user_id=None):
if request.method == 'POST':
if form.validate():
- print("Form validated...")
role_user = Role.query.filter(Role.name == "user").first()
if user_id is not None:
# Edit a user
@@ -702,7 +700,6 @@ def create_user(user_id=None):
flash(gettext('User') + ' ' + user.nickname + ' ' + gettext('successfully updated.'), 'success')
else:
# Create a new user
- print("A new user...")
user = User(nickname=form.nickname.data,
email=form.email.data,
pwdhash=generate_password_hash(form.password.data))
@@ -713,7 +710,6 @@ def create_user(user_id=None):
flash(gettext('User') + ' ' + user.nickname + ' ' + gettext('successfully created.'), 'success')
return redirect("/admin/edit_user/"+str(user.id))
else:
- print("Problem with the form")
return redirect(url_for('create_user'))
if request.method == 'GET':
bgstack15