Fix GitLab issue #250 "Empty optional lookup metadata trigger validation error". Thanks to LeVon Smoker for the find and for the proposed fix.

Reference: https://groups.google.com/forum/#!topic/mayan-edms/VUGRl4xX-1c
This commit is contained in:
Roberto Rosario
2016-02-09 13:00:45 -04:00
parent 2300f4d793
commit 59624d75cb
2 changed files with 28 additions and 4 deletions

View File

@@ -126,7 +126,7 @@ class MetadataType(models.Model):
if self.lookup:
lookup_options = self.get_lookup_values()
if value not in lookup_options:
if value and value not in lookup_options:
raise ValidationError(
_('Value is not one of the provided options.')
)