-
Notifications
You must be signed in to change notification settings - Fork 4
Conversation
Setting a date back to empty is not possible using fromClient right now: Empty string is converted to None, and None is not allowed by super-call to baseBone.isInvalid() as valid value. So this might fix the problem and integrates with [#32](viur-framework/viur-vi#32) in vi.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the changes to the CHANGELOG
Not sure if this will break anything (the correct way would be to fix isInvalid and the correct handling of errors in non-required bones). If you tested it we can merge it and fix it correctly in Server 3.0 |
We can do it using |
I don't care, if it does not break anything (i don't think it will but everyone should have a look on this). As said this will be fixed correctly in 3.0, this has to work only for a year or two :) |
bones/dateBone.py
Outdated
@@ -158,7 +158,7 @@ def fromClient( self,valuesCache, name, data ): | |||
else: | |||
err = self.isInvalid(value) | |||
if not err: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After further investigation i would recommend reverting these two changes and change this line to "if not err or value is None". This should do the trick and be more consistent with other bones
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK make it so!
Setting a date back to empty is not possible using fromClient right now: Empty string is converted to None, and None is not allowed by super-call to baseBone.isInvalid() as valid value. So this might fix the problem and integrates with #32 in vi.