django-allauth 0.30.0 released
Posted by Raymond Penners on 2017-01-01
Note worthy changes
- Changed the algorithm that generates unique usernames. Previously, in case the provider did not hand over any information to base the username on, the username "user" extended with an ever increasing numeric suffix would be attempted until a free username was found. In case of a large number of existing users, this could result in many queries being executed before a free username would be found, potentially resulting in a denial of service. The new algorithm uses a random suffix and only one query to determine the final username.
- Added a new setting: ACCOUNT_PRESERVE_USERNAME_CASING. This setting determines whether the username is stored in lowercase (False) or whether its casing is to be preserved (True). Note that when casing is preserved, potentially expensive __iexact lookups are performed when filter on username. For now, the default is set to True to maintain backwards compatibility.
- The OAuth2Adapter class has gained a get_callback_url method for when customizing the callback URL is desired.
- The Battle.net login backend now accepts the region GET parameter.
- New providers: 500px, Discord.
Backwards incompatible changes
- In previous versions, the DefaultAccountAdapter contained a username_regex property and accompanying error_messages['invalid_username'] validation error message. These have been removed in favor of using the regex validation already defined at the user model level. Alternatively, you can use the newly introduced ACCOUNT_USERNAME_VALIDATORS setting.
- The Battle.net backend no longer overrides username regex validation. In order to use battletags as usernames, you are expected to override either the username field on your User model, or to pass a custom validator which will accept the # character using the new ACCOUNT_USERNAME_VALIDATORS setting. Such a validator is available in socialaccount.providers.battlenet.validators.BattletagUsernameValidator.
Next: django-allauth 0.31.0 released Previous: django-allauth 0.29.0 released