#34032: Base authentication Backend should raise NotImplemented on needed
methods
-------------------------------------+-------------------------------------
Reporter: Dre Westcook | Owner:
| piyushdivyankar1994
Type: Uncategorized | Status: assigned
Component: contrib.auth | Version: 4.0
Severity: Normal | Resolution:
Keywords: authentication | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Vishal):
Replying to [comment:3 piyushdivyankar1994]:
> I have made the following changes
>
> {{{
> diff --git a/django/contrib/auth/backends.py
b/django/contrib/auth/backends.py
> index 4adcf35051..b73d1f9f57 100644
> --- a/django/contrib/auth/backends.py
> +++ b/django/contrib/auth/backends.py
> @@ -11,10 +11,12 @@ UserModel = get_user_model()
>
> class BaseBackend:
> def authenticate(self, request, **kwargs):
> - return None
> + raise NotImplementedError(
> + "This .authenticate(self, request, **kwargs) must be
implemented."
> + )
>
> def get_user(self, user_id):
> - return None
> + raise NotImplementedError("This .get_user(self, ...) must be
implemented.")
>
> def get_user_permissions(self, user_obj, obj=None):
> return set()
> }}}
>
> I am unsure if this is what is required.
Raised P.R https://github.com/django/django/pull/16086/
--
Ticket URL: <https://code.djangoproject.com/ticket/34032#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701836accf512-0886ee01-1a6f-48c0-a167-385f9b93490e-000000%40eu-central-1.amazonses.com.