#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 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.
--
Ticket URL: <https://code.djangoproject.com/ticket/34032#comment:3>
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/0107018369b9fc85-c2f652dc-7177-43fc-bcdf-d2b591ab26bf-000000%40eu-central-1.amazonses.com.