Refactored the validation error messages
This commit is contained in:
parent
fff468f95f
commit
9883a3f908
1 changed files with 3 additions and 3 deletions
|
@ -248,21 +248,21 @@ class IndexView(CreateView):
|
||||||
try:
|
try:
|
||||||
cores = cores_field.clean(cores)
|
cores = cores_field.clean(cores)
|
||||||
except ValidationError as err:
|
except ValidationError as err:
|
||||||
msg = '{} {}.'.format(cores, _('is not a proper cores number'))
|
msg = '{} : {}.'.format(cores, str(err))
|
||||||
messages.add_message(self.request, messages.ERROR, msg, extra_tags='cores')
|
messages.add_message(self.request, messages.ERROR, msg, extra_tags='cores')
|
||||||
return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form")
|
return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
memory = memory_field.clean(memory)
|
memory = memory_field.clean(memory)
|
||||||
except ValidationError as err:
|
except ValidationError as err:
|
||||||
msg = '{} {}.'.format(memory, _('is not a proper memory number'))
|
msg = '{} : {}.'.format(memory, str(err))
|
||||||
messages.add_message(self.request, messages.ERROR, msg, extra_tags='memory')
|
messages.add_message(self.request, messages.ERROR, msg, extra_tags='memory')
|
||||||
return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form")
|
return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
storage = storage_field.clean(storage)
|
storage = storage_field.clean(storage)
|
||||||
except ValidationError as err:
|
except ValidationError as err:
|
||||||
msg = '{} {}.'.format(storage, _('is not a proper storage number'))
|
msg = '{} : {}.'.format(storage, str(err))
|
||||||
messages.add_message(self.request, messages.ERROR, msg, extra_tags='storage')
|
messages.add_message(self.request, messages.ERROR, msg, extra_tags='storage')
|
||||||
return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form")
|
return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue