Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Allow empty date setting to dateBone #155

Merged
merged 2 commits into from
May 14, 2019

Conversation

phorward
Copy link
Member

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.

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.
@phorward phorward added this to the v2.4.0 milestone Apr 15, 2019
skoegl
skoegl previously approved these changes Apr 15, 2019
Copy link
Member

@sveneberth sveneberth left a 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

@tsteinruecken
Copy link
Contributor

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

@phorward
Copy link
Member Author

We can do it using isInvalid() as well.. what would be your most favorite solution?

@tsteinruecken
Copy link
Contributor

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 :)

@@ -158,7 +158,7 @@ def fromClient( self,valuesCache, name, data ):
else:
err = self.isInvalid(value)
if not err:
Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK make it so!

@tsteinruecken tsteinruecken merged commit a6abf40 into develop May 14, 2019
@tsteinruecken tsteinruecken deleted the bugfix/dateBone.fromClient branch May 14, 2019 14:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants