From 1d7f447dad72652adddfb1ecb90e793106be86e6 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Sun, 23 Aug 2015 22:44:47 -0400 Subject: [PATCH] Raise validation error without specifying the field as this code can be called for a collection of instances. --- mayan/apps/metadata/models.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mayan/apps/metadata/models.py b/mayan/apps/metadata/models.py index 991494d5f2..8671ca04c1 100644 --- a/mayan/apps/metadata/models.py +++ b/mayan/apps/metadata/models.py @@ -114,18 +114,14 @@ class MetadataType(models.Model): if not value and self.get_required_for(document_type=document_type): raise ValidationError( - { - 'value': _( - 'This metadata is required for this document type.' - ) - } + _('This metadata is required for this document type.') ) if self.lookup: lookup_options = self.get_lookup_values() if value not in lookup_options: raise ValidationError( - {'value': _('Value is not one of the provided options.')} + _('Value is not one of the provided options.') ) if self.validation: