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

Running migration on phonenumberfield results in AttributeError #123

Closed
dedayoa opened this issue Apr 22, 2016 · 0 comments
Closed

Running migration on phonenumberfield results in AttributeError #123

dedayoa opened this issue Apr 22, 2016 · 0 comments

Comments

@dedayoa
Copy link

dedayoa commented Apr 22, 2016

I've got the straight up install of django-phonenumber-field, with phonenumberslite.
See extract from running pipdeptree below.

`django-phonenumber-field==1.1.0

  • phonenumberslite [required: >=7.0.2, installed: 7.3.1]
  • babel [installed: 2.3.3]
    • pytz [required: >=0a, installed: 2016.3]`

When I run manage.py migrate, I get

File "C:\Users\...\lib\site-packages\phonenumber_field\modelfields.py", line 76, in get_prep_value return value.format_as(fmt) AttributeError: 'NoneType' object has no attribute 'format_as'

as the last entry in the error trace.

I'm running Python 3.4.3
Any suggestion to what is causing this? How can I remedy as it is preventing my migrations from successfully running.

dedayoa added a commit to dedayoa/django-phonenumber-field that referenced this issue Apr 22, 2016
The patch to get_prep_value() allows manage.py migrate to successfully complete. This is to address issue "Running migration on phonenumberfield results in AttributeError stefanfoulis#123"

As per https://docs.djangoproject.com/en/1.8/howto/custom-model-fields/#custom-field-deconstruct-method, I also added the deconstruct method. I don't know if my migration will run without this, but figure since it's required, it should stay.
@amateja amateja closed this as completed Jun 3, 2016
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

2 participants