bepasty: Use generic form template for add password view

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2022-08-30 22:18:45 -07:00 committed by James Valleroy
parent 2b48f10cfb
commit 7d0d95d163
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
3 changed files with 3 additions and 25 deletions

View File

@ -1,23 +0,0 @@
{% extends "base.html" %}
{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load bootstrap %}
{% load i18n %}
{% load static %}
{% block content %}
<h3>{{ title }}</h3>
<form class="form form-add" method="post">
{% csrf_token %}
{{ form|bootstrap }}
<input type="submit" class="btn btn-primary"
value="{% trans "Submit" %}"/>
</form>
{% endblock %}

View File

@ -73,7 +73,7 @@ def _add_password(browser):
browser.find_by_css('#id_bepasty-permissions input[value="{}"]'.format(
permission)).check()
browser.fill('bepasty-comment', 'bepasty functional test')
functional.submit(browser, form_class='form-add')
functional.submit(browser, form_class='form-bepasty')
def _remove_all_passwords(browser):

View File

@ -97,9 +97,10 @@ class BepastyView(AppView):
class AddPasswordView(SuccessMessageMixin, FormView):
"""View to add a new password."""
form_class = AddPasswordForm
prefix = 'bepasty'
template_name = 'bepasty_add.html'
template_name = 'form.html'
success_url = reverse_lazy('bepasty:index')
success_message = _('Password added.')