devilry / devilry-django

Devilry project main repository
http://devilry.org
BSD 3-Clause "New" or "Revised" License
51 stars 24 forks source link

django-allauth 0.55+ compatibility #1270

Closed torgeirl closed 10 months ago

torgeirl commented 1 year ago

django-allauth 0.55.0 (released August 22) has multiple backwards incompatible issues in their changelog, and at least one of them makes it incompatible with Devilry 6.0.0:

A large internal refactor has been performed to be able to add support for providers oferring one or more subproviders. This refactor has the following impact:

  • The provider registry methods get_list(), by_id() have been removed. The registry now only providers access to the provider classes, not the instances.
  • (...)

This is used in devilry_authenticate/views/allauth_views.py:

    (...)
    def get(self, *args, **kwargs):
        allauth_backend = 'allauth.account.auth_backends.AuthenticationBackend'
        all_providers = providers.registry.get_list(request=self.request)
        (...)

django-allauth 0.56.0 got released on September 7, and included further backwards incompatible changes, most notably:

Levijatan commented 10 months ago

Accidently closed this via commitzen, but yes pushed up a fix for this.

Levijatan commented 10 months ago

Also something to note earlier it listed up all registered login providers at the login screen but because of changes to django-allauth it now only lists up providers where the socialapp is configured.

torgeirl commented 10 months ago

Running Devilry 6.1 with Django Allauth v0.57 or v0.58 yields 'DevilryDataportenProvider' object has no attribute 'get_app', which was removed as a backwards incompatible change in V0.55:

  • provider.get_app() has been removed -- use provider.app instead.

I accidentally tested with v0.57, and for a minute I thought the problem was caused by the the refactoring in v0.58 since my testing with v0.57 was successfully:

Refactored the built-in templates, with the goal of being able to adjust the look and feel of the whole project by only overriding a few core templates. This approach allows you to achieve visual results fast, but is of course more limited compared to styling all templates yourself. If your project provided its own templates then this change will not affect anything, but if you rely on (some of) the built-in templates your project may be affected.

This does however effect both v0.57 and v0.58, but it only triggers for new sessions («federated look-up») which is why it evaded my initial testing. And due to these re-writes, Devilry 6.1.0 is incompatible with v0.56 or lower so downgrading isn't an option.

torgeirl commented 10 months ago

Solved in f4f332dd247eeed077e8c20e6e2fed95ba136ec1.