Allow the backend to clean the username, if the backend defines a clean_username method.
(self, username, request)
| 215 | await auth.alogin(request, user) |
| 216 | |
| 217 | def clean_username(self, username, request): |
| 218 | """ |
| 219 | Allow the backend to clean the username, if the backend defines a |
| 220 | clean_username method. |
| 221 | """ |
| 222 | backend_str = request.session[auth.BACKEND_SESSION_KEY] |
| 223 | backend = auth.load_backend(backend_str) |
| 224 | try: |
| 225 | username = backend.clean_username(username) |
| 226 | except AttributeError: # Backend has no clean_username method. |
| 227 | pass |
| 228 | return username |
| 229 | |
| 230 | async def aclean_username(self, username, request): |
| 231 | """See clean_username.""" |
no outgoing calls
no test coverage detected