Display error details

The red error box will now show why a lease failed to be created or
updated, for example if not enough resources are available.

Also remove "Please try again" which is not a helpful message.

Change-Id: Id0b39fd151956ae6b08ab503a7ae0c5dc09af7f6
This commit is contained in:
Pierre Riteau 2022-02-15 12:35:58 +01:00
parent d30f9f45aa
commit fb9ae6e2c2
3 changed files with 7 additions and 3 deletions

View File

@ -48,7 +48,7 @@ class UpdateForm(forms.SelfHandlingForm):
LOG.error('Error updating host: %s', e)
exceptions.handle(request,
message="An error occurred while updating this"
" host. Please try again.")
" host: %s." % e)
def clean(self):
cleaned_data = super(UpdateForm, self).clean()

View File

@ -209,7 +209,7 @@ class CreateForm(forms.SelfHandlingForm):
LOG.error('Error submitting lease: %s', e)
exceptions.handle(request,
message='An error occurred while creating this '
'lease. Please try again.')
'lease: %s.' % e)
def clean(self):
cleaned_data = super(CreateForm, self).clean()
@ -314,7 +314,7 @@ class UpdateForm(forms.SelfHandlingForm):
LOG.error('Error updating lease: %s', e)
exceptions.handle(request,
message="An error occurred while updating this"
" lease. Please try again.")
" lease: %s." % e)
def clean(self):
cleaned_data = super(UpdateForm, self).clean()

View File

@ -0,0 +1,4 @@
---
features:
- |
Error details are now displayed when failing to create or update leases.