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 %} +