This commit is contained in:
lsacienne 2022-02-18 16:35:10 +01:00
commit c66df77d4a
4 changed files with 12 additions and 10 deletions

View File

@ -73,7 +73,7 @@ urlpatterns = [
re_path(r"^register$", register, name="register"),
# Group handling
re_path(r"^group/$", GroupListView.as_view(), name="group_list"),
re_path(r"^group/new$", GroupCreateView.as_view(), name="group_new"),
re_path(r"^group/new/$", GroupCreateView.as_view(), name="group_new"),
re_path(
r"^group/(?P<group_id>[0-9]+)/$", GroupEditView.as_view(), name="group_edit"
),

View File

@ -37,7 +37,7 @@ from django import forms
from ajax_select.fields import AutoCompleteSelectMultipleField
from core.models import RealGroup, User
from core.views import CanEditMixin, DetailFormView
from core.views import CanCreateMixin, CanEditMixin, DetailFormView
# Forms
@ -109,13 +109,13 @@ class GroupEditView(CanEditMixin, UpdateView):
fields = ["name", "description"]
class GroupCreateView(CanEditMixin, CreateView):
class GroupCreateView(CanCreateMixin, CreateView):
"""
Add a new Group
"""
model = RealGroup
template_name = "core/group_edit.jinja"
template_name = "core/create.jinja"
fields = ["name", "description"]

View File

@ -191,10 +191,10 @@ class EbouticTest(TestCase):
)
response = self.generate_bank_valid_answer_from_page_content(response.content)
self.assertTrue(response.status_code == 400)
self.assertTrue(
"Payment failed with error: SuspiciousOperation('Basket total and amount do not match'"
in response.content.decode("utf-8")
self.assertEqual(response.status_code, 500)
self.assertIn(
"Basket processing failed with error: SuspiciousOperation('Basket total and amount do not match'",
response.content.decode("utf-8"),
)
def test_buy_refill_product_with_credit_card(self):

View File

@ -301,9 +301,11 @@ class EtransactionAutoAnswer(View):
i.validate()
b.delete()
except Exception as e:
return HttpResponse("Payment failed with error: " + repr(e), status=400)
return HttpResponse(
"Basket processing failed with error: " + repr(e), status=500
)
return HttpResponse()
else:
return HttpResponse(
"Payment failed with error: " + request.GET["Error"], status=400
"Payment failed with error: " + request.GET["Error"], status=202
)