New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EncryptedDateField and EncryptedDateTimeField Broken #4
Comments
The above changes work for when the model field is set to "blank=False, null=False". Still working on getting it to work for "blank=True, null=False" |
I have a patch with a bunch of fixes and modifications. I'd like to get involved. How do I submit it to you? (sorry, kind of new to github still) |
@JoeJasinski I don't have commit rights to the system, but typically people fork the repository, make the changes, and then make a 'pull request' back to the owners of this repository. |
Joe, please, fork the repository, modify it and send me a pull request. But please, add a unittest for the issue. |
Thanks AdamN and svetlyak40wt, I'll update with my changes and send you a request. |
As an update, I've forked the code and have added my changes. I'm still working on adding unit tests, but time has been scarse lately. I'll let you know when those are done. |
When using an EncryptedDateField, I get the following error:
invalid literal for int() with base 10:''
I think this is because when the ModelForm first renders an empty form, the to_python function is passed an empty value and therefore breaks when trying to do the split:
date_value = self.date_class(*map(int, date_text.split(':')))
(I think) I was able to solve this by adding a test to check if the value is empty in the to_python function. Also, once I added this check, I was able to enter values that match only the string format YYYY:MM:DD. To solve this, I added a form_class to the formfield defaults.
Not sure how to submit patches or changes on Github (still new to it), but here's my changes so far. I can submit in a better format if needed. Let me know what you think....
Joe
The text was updated successfully, but these errors were encountered: