diff options
author | Cédric Bonhomme <kimble.mandel+bitbucket@gmail.com> | 2015-08-06 23:36:13 +0200 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel+bitbucket@gmail.com> | 2015-08-06 23:36:13 +0200 |
commit | 481d30d4b5d46608a7f0b5cf1122293bc61d3ea5 (patch) | |
tree | 4e8690425332988b84e62ebcd334f7bcb30bf89d /pyaggr3g470r/views/views.py | |
parent | Ensuere that the arguments is an integer. (diff) | |
parent | fixing bug preventing from bumping error count from api crawler for none admi... (diff) | |
download | newspipe-481d30d4b5d46608a7f0b5cf1122293bc61d3ea5.tar.gz newspipe-481d30d4b5d46608a7f0b5cf1122293bc61d3ea5.tar.bz2 newspipe-481d30d4b5d46608a7f0b5cf1122293bc61d3ea5.zip |
Merged in jaesivsm/pyaggr3g470r (pull request #21)
fixing bug on http crawler and light refact
Diffstat (limited to 'pyaggr3g470r/views/views.py')
-rw-r--r-- | pyaggr3g470r/views/views.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/pyaggr3g470r/views/views.py b/pyaggr3g470r/views/views.py index 69c2b50b..560bd382 100644 --- a/pyaggr3g470r/views/views.py +++ b/pyaggr3g470r/views/views.py @@ -718,8 +718,10 @@ def create_user(user_id=None): user.activation_key = "" db.session.add(user) db.session.commit() - flash(gettext('User') + ' ' + user.nickname + ' ' + gettext('successfully created.'), 'success') - return redirect("/admin/edit_user/"+str(user.id)) + flash("%s %s %s" % (gettext('User'), user.nickname, + gettext('successfully created.')), + 'success') + return redirect(url_for('create_user', user_id=user.id)) else: return redirect(url_for('create_user')) @@ -727,11 +729,13 @@ def create_user(user_id=None): if user_id is not None: user = User.query.filter(User.id == user_id).first() form = UserForm(obj=user) - message = gettext('Edit the user') + ' <i>' + user.nickname + '</i>' + message = "%s <i>%s</i>" % (gettext('Edit the user'), + user.nickname) else: form = UserForm() message = gettext('Add a new user') - return render_template('/admin/create_user.html', form=form, message=message) + return render_template('/admin/create_user.html', + form=form, message=message) @app.route('/admin/user/<int:user_id>', methods=['GET']) @login_required @@ -743,10 +747,9 @@ def user(user_id=None): user = UserController().get(id=user_id) if user is not None: article_contr = ArticleController(user_id) - return render_template('/admin/user.html', user=user, + return render_template('/admin/user.html', user=user, feeds=user.feeds, article_count=article_contr.count_by_feed(), - unread_article_count=article_contr.count_by_feed(readed=False), - ) + unread_article_count=article_contr.count_by_feed(readed=False)) else: flash(gettext('This user does not exist.'), 'danger') |