diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-05-04 19:47:00 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-05-04 19:47:00 +0200 |
commit | 5dee29c0c0faf299824503b0060ef16dd1a43eb8 (patch) | |
tree | 5a3c3f79641a7dcd71372493d1e2b9f18258f5e0 | |
parent | Updated translations. (diff) | |
download | newspipe-5dee29c0c0faf299824503b0060ef16dd1a43eb8.tar.gz newspipe-5dee29c0c0faf299824503b0060ef16dd1a43eb8.tar.bz2 newspipe-5dee29c0c0faf299824503b0060ef16dd1a43eb8.zip |
The user has now the possibility to delete it's account.
-rw-r--r-- | messages.pot | 45 | ||||
-rw-r--r-- | pyaggr3g470r/templates/management.html | 5 | ||||
-rw-r--r-- | pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo | bin | 8637 -> 8775 bytes | |||
-rw-r--r-- | pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po | 47 | ||||
-rw-r--r-- | pyaggr3g470r/views.py | 16 |
5 files changed, 75 insertions, 38 deletions
diff --git a/messages.pot b/messages.pot index 1c528c54..d2f7b373 100644 --- a/messages.pot +++ b/messages.pot @@ -8,7 +8,7 @@ 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" +"POT-Creation-Date: 2014-05-04 19:44+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -176,11 +176,11 @@ msgid "Feed" msgstr "" #: pyaggr3g470r/views.py:554 pyaggr3g470r/views.py:610 -#: pyaggr3g470r/views.py:654 +#: pyaggr3g470r/views.py:668 msgid "successfully updated." msgstr "" -#: pyaggr3g470r/views.py:566 pyaggr3g470r/views.py:665 +#: pyaggr3g470r/views.py:566 pyaggr3g470r/views.py:679 msgid "successfully created." msgstr "" @@ -196,25 +196,30 @@ msgstr "" msgid "Add a feed" msgstr "" -#: pyaggr3g470r/views.py:592 pyaggr3g470r/views.py:705 +#: pyaggr3g470r/views.py:592 pyaggr3g470r/views.py:719 msgid "successfully deleted." msgstr "" -#: 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 "" -#: pyaggr3g470r/views.py:674 -msgid "Edit the user" +#: pyaggr3g470r/views.py:629 +msgid "Your account has been deleted." msgstr "" -#: pyaggr3g470r/views.py:677 pyaggr3g470r/templates/admin/dashboard.html:35 -msgid "Add a new user" +#: pyaggr3g470r/views.py:631 pyaggr3g470r/views.py:705 +#: pyaggr3g470r/views.py:721 +msgid "This user does not exist." msgstr "" -#: pyaggr3g470r/views.py:691 pyaggr3g470r/views.py:707 -msgid "This user does not exist." +#: pyaggr3g470r/views.py:688 +msgid "Edit the user" +msgstr "" + +#: pyaggr3g470r/views.py:691 pyaggr3g470r/templates/admin/dashboard.html:35 +msgid "Add a new user" msgstr "" #: pyaggr3g470r/templates/about.html:5 @@ -492,30 +497,34 @@ msgid "Last seen:" msgstr "" #: pyaggr3g470r/templates/management.html:26 +msgid "Delete your account" +msgstr "" + +#: pyaggr3g470r/templates/management.html:31 msgid "Import/export feeds" msgstr "" -#: pyaggr3g470r/templates/management.html:27 +#: pyaggr3g470r/templates/management.html:32 msgid "Import" msgstr "" -#: pyaggr3g470r/templates/management.html:29 +#: pyaggr3g470r/templates/management.html:34 msgid "Batch import feeds from OPML" msgstr "" -#: pyaggr3g470r/templates/management.html:29 +#: pyaggr3g470r/templates/management.html:34 msgid "or" msgstr "" -#: pyaggr3g470r/templates/management.html:32 +#: pyaggr3g470r/templates/management.html:37 msgid "Export" msgstr "" -#: pyaggr3g470r/templates/management.html:33 +#: pyaggr3g470r/templates/management.html:38 msgid "Export feeds to OPML" msgstr "" -#: pyaggr3g470r/templates/management.html:36 +#: pyaggr3g470r/templates/management.html:41 msgid "Export articles" msgstr "" 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 @@ <img src="{{ user.email | gravatar }}" /> </div> </div> + <div class="row"> + <div class="col-md-12"> + <a href="/delete_account/" class="btn btn-default">{{ _('Delete your account') }}</a> + </div> + </div> </div> <div class="jumbotron"> <h1>{{ _('Import/export feeds') }}</h1> diff --git a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo Binary files differindex f508de77..0df0a5ca 100644 --- a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo +++ b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo 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 <cedric@cedricbonhomme.org>\n" "Language-Team: fr <LL@li.org>\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: |