From ef55b4e479759e378e9c6d39c218b9e71b1fdc03 Mon Sep 17 00:00:00 2001 From: Joachim Lusiardi Date: Tue, 24 May 2016 23:55:58 +0200 Subject: [PATCH] First step --- app/rollerverbrauch/__init__.py | 13 ++++++++++++- app/rollerverbrauch/forms.py | 4 ++++ app/rollerverbrauch/templates/account.html | 8 ++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/app/rollerverbrauch/__init__.py b/app/rollerverbrauch/__init__.py index 3581461..b960590 100644 --- a/app/rollerverbrauch/__init__.py +++ b/app/rollerverbrauch/__init__.py @@ -27,7 +27,8 @@ from rollerverbrauch.forms import \ CreatePitstopForm, \ EditVehicleForm, \ DeleteVehicleForm, \ - SelectVehicleForm + SelectVehicleForm, \ + DeleteAccountForm from rollerverbrauch.entities import \ User, \ @@ -217,3 +218,13 @@ def get_statistics(): for vehicle in current_user.vehicles: stats.append(tools.VehicleStats(vehicle)) return render_template('statistics.html', data=stats) + +@app.route('/account/delete', methods=['GET', 'POST']) +@login_required +def delete_account(): + form = DeleteAccountForm() + + if form.validate_on_submit(): + return redirect(url_for('get_account_page')) + + return render_template('deleteVehicleForm.html', form=form, vehicle=vehicle) diff --git a/app/rollerverbrauch/forms.py b/app/rollerverbrauch/forms.py index 7e5bd3c..6649433 100644 --- a/app/rollerverbrauch/forms.py +++ b/app/rollerverbrauch/forms.py @@ -44,3 +44,7 @@ class EditVehicleForm(Form): class DeleteVehicleForm(Form): submit = SubmitField(label='Do it!') + + +class DeleteAccountForm(Form): + submit = SubmitField(label='Do it!') diff --git a/app/rollerverbrauch/templates/account.html b/app/rollerverbrauch/templates/account.html index 8cec4de..73ba1d7 100644 --- a/app/rollerverbrauch/templates/account.html +++ b/app/rollerverbrauch/templates/account.html @@ -53,4 +53,12 @@ {% endfor %} +
+
Account
+ +
{% endblock %}