georgemarshall / django-cryptography

Easily encrypt data in Django
https://django-cryptography.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
371 stars 70 forks source link

Could not encripte custom auth user email field #28

Closed lijoev closed 4 years ago

lijoev commented 4 years ago

I have modified django auth to use email as my username. I need to save the email encripted using django-cryptography. I tried to use encrypt function in email field in my model.py. but it throws me the below error

django.core.exceptions.FieldError: Unsupported lookup 'exact' for EncryptedEmailField or join on the field not permitted, perhaps you meant exact or iexact?

I get this error when i create superuser and register new user.

georgemarshall commented 4 years ago

Encrypted fields are not indexable, as such you are not able to perform any matches against the fields contents.

Bastien-Brd commented 4 years ago

@lijoev my comment on another similar issue might help you: https://github.com/georgemarshall/django-cryptography/issues/10#issuecomment-553347255