I fixed the problem by changing line 129 in mayan/apps/metadata/models.py
from:
if self.lookup:
lookup_options = self.get_lookup_values()
if value not in lookup_options:
raise ValidationError(
_('Value is not one of the provided options.')
)
to:
if self.lookup:
lookup_options = self.get_lookup_values()
if value and value not in lookup_options:
raise ValidationError(
_('Value is not one of the provided options.')
)
Adding the 'value and' to the if statement allows empty values. Of course
if the metadata type is required, that will be caught by the preceding code
and raise the appropriate error.
Thoughts?
LeVon S.
On Monday, February 1, 2016 at 1:44:15 PM UTC-5, LeVon Smoker wrote:
>
> I'm having trouble getting optional metadata types to work when the type
> has a list of lookup options. When I try to upload a document that has
> optional metadata and I don't choose from the dropdown boxes, I get an
> error message - "Value is not one of the provided options." See the
> attachment. For the "Meeting Type" metadata I have 'Board', 'Management
> Team', 'Supervisors' entered as options in the Lookup field. I could add a
> value of None to the list but I think that defeats the purpose of allowing
> for optional vs required metadata based on document type.
>
> Or am I missing something?
>
> Thanks,
> LeVon Smoker
>
--
---
You received this message because you are subscribed to the Google Groups
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.