omab / python-social-auth

Social auth made simple
http://psa.matiasaguirre.net
BSD 3-Clause "New" or "Revised" License
2.83k stars 1.09k forks source link

Django 1.9 RemovedInDjango20Warning: Usage of field.rel has been deprecated. Use field.remote_field instead. #1014

Closed RevolutionTech closed 7 years ago

RevolutionTech commented 8 years ago

Line 61 of social/apps/django_app/default/models.py uses field.rel: https://github.com/omab/python-social-auth/blob/aa907384636a8ea87b86db3d5ab1580440e71665/social/apps/django_app/default/models.py#L61

This causes a warning in Django 1.9, but in Django 2.0 this code will cease to work.

On a related note, ForeignObjectRel.to was deprecated in favour of the model attribute. Original exception message: Usage of ForeignObjectRel.to attribute has been deprecated. Use the model attribute instead.

Ref: https://docs.djangoproject.com/en/1.9/releases/1.9/#field-rel-changes

omab commented 7 years ago

Fix for this got merged in the new split components python-social-auth.

RevolutionTech commented 7 years ago

It doesn't look like this was fixed in social-app-django: https://github.com/python-social-auth/social-app-django/blob/e368f5305ecb469ae0908b0fa24b8c1797d3d22c/social_django/models.py#L62

I suppose the more relevant issue for this now would be https://github.com/python-social-auth/social-app-django/issues/6 though.