Skip to content
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 Still Broken #54

Open
PeterCat12 opened this issue Jun 2, 2017 · 0 comments
Open

EncryptedDateField Still Broken #54

PeterCat12 opened this issue Jun 2, 2017 · 0 comments

Comments

@PeterCat12
Copy link

Similar to (and maybe a result of whatever fix was implemented for) issue 4.

django 1.8
python 2.7

My relevant form code:

class PatientInformationForm(forms.ModelForm):
    date_of_birth = forms.DateField(
         widget=TriSelectDateWidget(required=False, years=input_choices.DOB_YEAR_RANGE))

My relevant model:

class PatientInformation(models.Model):
     date_of_birth = enc_fields.EncryptedDateTimeField()

Upon form submission django_fields produces the error:
AttributeError at /registration/patient/ 'datetime.date' object has no attribute 'split'

If I cast the date_of_birth to a string in my form's clean method I encounter the same error described in issue 4.

I have a temporary work around but I think it should ultimately be resolved by django_fields:

def clean_date_of_birth(self):
        # hackish workaround...
        data = self.cleaned_data['date_of_birth']
        data = str(data)
        data = data.replace('-', ':')
        return data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant