pennersr / django-allauth

Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication.
https://allauth.org
MIT License
9.51k stars 3.03k forks source link

Request to Make provider Field Unique in SocialApp Model #3429

Closed Alihassanc5 closed 1 year ago

Alihassanc5 commented 1 year ago

I would like to propose adding the unique=True constraint to the provider field in the SocialApp model. Currently, the absence of this constraint can lead to potential issues where multiple SocialApp objects with the same provider value can be created, causing unexpected behavior and database errors like "Multiple object returned in queryset."

I am happy to contribute by writing a pull request to implement this change. Please consider this proposal for the benefit of data consistency and maintenance.

pennersr commented 1 year ago

When using the sites framework, you can assign a different app to a different sites.Site. Therefore, provider is intentionally not unique.