Skip to content

Commit

Permalink
Bug fix: display form errors when creating new tenant
Browse files Browse the repository at this point in the history
in case of form validation errors the page is displayed again but
previous implementation was hiding the error(s) b/c it was creating
a new form instance unconditionally.

With this chenge if a form instance already exists, possibly
containing errors, it will be reused. Otherwise we default to creating
a new form instance. The existing test should report PASS.
  • Loading branch information
atodorov committed Apr 24, 2020
1 parent ce0eb7b commit 4cebca8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tcms_github_marketplace/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def get_context_data(self, **kwargs):
self.purchase.effective_date)

context = super().get_context_data(**kwargs)
context['form'] = context['form'].__class__(
context['form'] = kwargs.get('form') or context['form'].__class__(
initial={
'on_trial': False,
'paid_until': paid_until,
Expand Down

0 comments on commit 4cebca8

Please sign in to comment.