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:
@@ -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.')
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user