Mercurial > hg > ltpdarepo
changeset 131:a4a1b9f582cd
Armonize flashed mesages.
author | Daniele Nicolodi <daniele@grinta.net> |
---|---|
date | Fri, 14 Oct 2011 11:05:31 +0200 |
parents | d034b1541bf1 |
children | aae5891e420d |
files | src/ltpdarepo/tests/manage-databases.txt src/ltpdarepo/views/databases.py src/ltpdarepo/views/users.py |
diffstat | 3 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ltpdarepo/tests/manage-databases.txt Fri Oct 14 11:05:31 2011 +0200 +++ b/src/ltpdarepo/tests/manage-databases.txt Fri Oct 14 11:05:31 2011 +0200 @@ -33,7 +33,7 @@ >>> browser.url 'http://localhost/manage/databases/' >>> browser.contents - '...<div class="flash message">Database "database1" created.</div>...' + '...<div class="flash message">Database created.</div>...' View database:: @@ -52,7 +52,7 @@ >>> browser.url 'http://localhost/manage/databases/database1' >>> browser.contents - '...<div class="flash message">Database "database1" modified.</div>...' + '...<div class="flash message">Database modified.</div>...' >>> browser.contents '...<p class="field"><span class="label">Description:</span> Test Database One</p>...' @@ -156,7 +156,7 @@ >>> browser.url 'http://localhost/manage/databases/' >>> browser.contents - '...<div class="flash message">Database "database1" deleted.</div>...' + '...<div class="flash message">Database deleted.</div>...' # Local Variables:
--- a/src/ltpdarepo/views/databases.py Fri Oct 14 11:05:31 2011 +0200 +++ b/src/ltpdarepo/views/databases.py Fri Oct 14 11:05:31 2011 +0200 @@ -41,7 +41,7 @@ db = Database() form.update(db) db.create() - flash(u'Database "%s" created.' % db.id) + flash(u'Database created.') return redirect(url_for('manage.databases.index')) return render_template('databases/create.html', form=form) @@ -57,7 +57,7 @@ if request.method == 'POST' and form.validate(): form.update(db) db.save() - flash('Database "%s" modified.' % db.id) + flash('Database modified.') return redirect(url_for('manage.databases.view', database=database)) return render_template('databases/edit.html', database=db, form=form) @@ -74,9 +74,9 @@ if request.method == 'POST' and form.validate(): if request.form.get('ok'): db.drop() - flash('Database "%s" deleted.' % db.id) + flash('Database deleted.') return redirect(url_for('manage.databases.index')) - flash("Operation cancelled.") + flash('Operation cancelled.') return redirect(url_for('manage.databases.view', database=database)) return render_template('databases/drop.html', database=db, form=form)
--- a/src/ltpdarepo/views/users.py Fri Oct 14 11:05:31 2011 +0200 +++ b/src/ltpdarepo/views/users.py Fri Oct 14 11:05:31 2011 +0200 @@ -196,7 +196,8 @@ if request.method == 'POST' and form.validate(): if request.form.get('ok'): user.delete() - flash('User "%s" deleted.' % username) + flash('User deleted.') + flash('Operation cancelled.') return redirect(url_for('manage.users.index')) return render_template('users/drop.html', form=form, user=user)