From 5dee29c0c0faf299824503b0060ef16dd1a43eb8 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sun, 4 May 2014 19:47:00 +0200 Subject: The user has now the possibility to delete it's account. --- pyaggr3g470r/templates/management.html | 5 +++ .../translations/fr/LC_MESSAGES/messages.mo | Bin 8637 -> 8775 bytes .../translations/fr/LC_MESSAGES/messages.po | 47 ++++++++++++--------- pyaggr3g470r/views.py | 16 ++++++- 4 files changed, 48 insertions(+), 20 deletions(-) (limited to 'pyaggr3g470r') diff --git a/pyaggr3g470r/templates/management.html b/pyaggr3g470r/templates/management.html index f68978b2..8dbe193a 100644 --- a/pyaggr3g470r/templates/management.html +++ b/pyaggr3g470r/templates/management.html @@ -21,6 +21,11 @@ +
+ +

{{ _('Import/export feeds') }}

diff --git a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo index f508de77..0df0a5ca 100644 Binary files a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo and b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo differ diff --git a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po index b441f6fa..aae342d3 100644 --- a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po +++ b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2014-05-04 19:30+0200\n" -"PO-Revision-Date: 2014-05-04 19:32+0100\n" +"POT-Creation-Date: 2014-05-04 19:44+0200\n" +"PO-Revision-Date: 2014-05-04 19:45+0100\n" "Last-Translator: Cédric Bonhomme \n" "Language-Team: fr \n" "Language: fr\n" @@ -178,11 +178,11 @@ msgid "Feed" msgstr "Flux" #: pyaggr3g470r/views.py:554 pyaggr3g470r/views.py:610 -#: pyaggr3g470r/views.py:654 +#: pyaggr3g470r/views.py:668 msgid "successfully updated." msgstr "mis à jour avec succès." -#: pyaggr3g470r/views.py:566 pyaggr3g470r/views.py:665 +#: pyaggr3g470r/views.py:566 pyaggr3g470r/views.py:679 msgid "successfully created." msgstr "créé avec succès." @@ -198,27 +198,32 @@ msgstr "Éditez ce flux" msgid "Add a feed" msgstr "Ajouter un flux" -#: pyaggr3g470r/views.py:592 pyaggr3g470r/views.py:705 +#: pyaggr3g470r/views.py:592 pyaggr3g470r/views.py:719 msgid "successfully deleted." msgstr "supprimé avec succès." -#: pyaggr3g470r/views.py:610 pyaggr3g470r/views.py:654 -#: pyaggr3g470r/views.py:665 pyaggr3g470r/views.py:705 +#: pyaggr3g470r/views.py:610 pyaggr3g470r/views.py:668 +#: pyaggr3g470r/views.py:679 pyaggr3g470r/views.py:719 msgid "User" msgstr "Utilisateur" -#: pyaggr3g470r/views.py:674 +#: pyaggr3g470r/views.py:629 +msgid "Your account has been deleted." +msgstr "Votre compte a été supprimé." + +#: pyaggr3g470r/views.py:631 pyaggr3g470r/views.py:705 +#: pyaggr3g470r/views.py:721 +msgid "This user does not exist." +msgstr "Cet utilisateur n'existe pas." + +#: pyaggr3g470r/views.py:688 msgid "Edit the user" msgstr "Éditer cet utilisateur" -#: pyaggr3g470r/views.py:677 pyaggr3g470r/templates/admin/dashboard.html:35 +#: pyaggr3g470r/views.py:691 pyaggr3g470r/templates/admin/dashboard.html:35 msgid "Add a new user" msgstr "Ajouter un nouvel utilisateur" -#: pyaggr3g470r/views.py:691 pyaggr3g470r/views.py:707 -msgid "This user does not exist." -msgstr "Cet utilisateur n'existe pas." - #: pyaggr3g470r/templates/about.html:5 msgid "" "This software is under AGPLv3 license. You are welcome to copy, modify or\n" @@ -499,30 +504,34 @@ msgid "Last seen:" msgstr "Vue la dernière fois le" #: pyaggr3g470r/templates/management.html:26 +msgid "Delete your account" +msgstr "Supprimer votre compte" + +#: pyaggr3g470r/templates/management.html:31 msgid "Import/export feeds" msgstr "Importer/exporter les flux" -#: pyaggr3g470r/templates/management.html:27 +#: pyaggr3g470r/templates/management.html:32 msgid "Import" msgstr "Importer" -#: pyaggr3g470r/templates/management.html:29 +#: pyaggr3g470r/templates/management.html:34 msgid "Batch import feeds from OPML" msgstr "Import en lot via un fichier OPML" -#: pyaggr3g470r/templates/management.html:29 +#: pyaggr3g470r/templates/management.html:34 msgid "or" msgstr "ou" -#: pyaggr3g470r/templates/management.html:32 +#: pyaggr3g470r/templates/management.html:37 msgid "Export" msgstr "Exporter" -#: pyaggr3g470r/templates/management.html:33 +#: pyaggr3g470r/templates/management.html:38 msgid "Export feeds to OPML" msgstr "Exporter les flux au format OPML" -#: pyaggr3g470r/templates/management.html:36 +#: pyaggr3g470r/templates/management.html:41 msgid "Export articles" msgstr "Exporter les articles" diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py index 4729cd0c..58a3b361 100644 --- a/pyaggr3g470r/views.py +++ b/pyaggr3g470r/views.py @@ -616,6 +616,20 @@ def profile(): form = ProfileForm(obj=user) return render_template('profile.html', user=user, form=form) +@app.route('/delete_account/', methods=['GET']) +@login_required +def delete_account(): + """ + Delete the account of the user (with all its data). + """ + user = User.query.filter(User.email == g.user.email).first() + if user is not None: + db.session.delete(user) + db.session.commit() + flash(gettext('Your account has been deleted.'), 'success') + else: + flash(gettext('This user does not exist.'), 'danger') + return redirect(url_for('home')) # @@ -696,7 +710,7 @@ def user(user_id=None): @admin_permission.require(http_exception=403) def delete_user(user_id=None): """ - Delete a user (with its stations and measures). + Delete a user (with all its data). """ user = User.query.filter(User.id == user_id).first() if user is not None: -- cgit