From 9883a3f9080a3474995027f2e983d20cb7d8558f Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 26 Jul 2017 01:55:31 +0530 Subject: [PATCH] Refactored the validation error messages --- datacenterlight/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index c7720e39..fc0b8b2e 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -248,21 +248,21 @@ class IndexView(CreateView): try: cores = cores_field.clean(cores) 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') return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form") try: memory = memory_field.clean(memory) 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') return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form") try: storage = storage_field.clean(storage) 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') return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form")