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

Update signature for Django 3 #25

Closed
wants to merge 1 commit into from
Closed

Conversation

jrenaut
Copy link

@jrenaut jrenaut commented Apr 12, 2020

Upgrading Django from 2.2 to 3.0.5 and getting this error when I try the built in admin for a model with encrypted fields

TypeError: from_db_value() missing 1 required positional argument: 'context'

Looks like the method signature was updated but someone already has a fix: https://luc.lino-framework.org/blog/2019/1128.html

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling b5426bd on jrenaut:master into 8f8cadb on orcasgit:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling b5426bd on jrenaut:master into 8f8cadb on orcasgit:master.

@xrmx
Copy link

xrmx commented Mar 4, 2021

It looks like something specific of the model field you are using, I can't find that parameter in django 2.2, 3.0 and 3.1 branches.

Actually there's a reference in 2.2 and it is that is has been removed in Django 3.0:

contrib/postgres/fields/array.py:            if func_supports_parameter(self.base_field.from_db_value, 'context')  # RemovedInDjango30Warning

@jrenaut
Copy link
Author

jrenaut commented Mar 28, 2021

I think you're right - I upgraded from 0.5 to 0.6 and upgraded a few other outdated packages and it's working now, so I'll close the pull request. I had extended EncryptedField but wasn't doing anything crazy - just needed to encrypt a decimal.

class EncryptedDecimalField(EncryptedField, models.DecimalField):
      pass

@jrenaut jrenaut closed this Mar 28, 2021
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

Successfully merging this pull request may close these issues.

None yet

3 participants