Modernize djblets/auth.
Review Request #13968 — Created June 10, 2024 and submitted
This change makes several modernizations for the auth app:
- Add `from future import annotations' to everything.
- Add type hints.
- Fix up a few small type issues that were exposed by type hints.
- Add in missing docstrings.
Ran unit tests.
Summary | ID |
---|---|
75ed6eb905e2b8cd0b0f885b0abc537c91a8fb5f |
Description | From | Last Updated |
---|---|---|
Can you add a Raises section in the docs while here. |
maubin | |
Same here. |
maubin | |
The parameter to check_password needs to be indented one level. Though, I wonder if we should avoid the cast and … |
chipx86 | |
Missing the full class path. |
chipx86 | |
'typing.cast' imported but unused Column: 1 Error code: F401 |
reviewbot |
- Description:
-
This change makes several modernizations for the auth app:
- Add `from future import annotations' to everything.
- Add type hints.
- Fix up a few small type issues that were exposed by type hints.
- Add in missing docstrings.
- - Testing Done:
- Ran unit tests. - Testing Done:
-
+ Ran unit tests.
- Commits:
-
Summary ID c411630327f35ff9de62ec77ece6a72662c54cbe 777c7e4e4566c1fea71e922922e28c4af4873253
Checks run (2 succeeded)
flake8
passed.
JSHint
passed.
- Commits:
-
Summary ID 777c7e4e4566c1fea71e922922e28c4af4873253 b9ea0aa76462b625872027672df0d8a5acf6aec8
Checks run (2 succeeded)
flake8
passed.
JSHint
passed.
-
-
The parameter to
check_password
needs to be indented one level.Though, I wonder if we should avoid the cast and instead first check for the errors and do something like:
if not form.errors.get(field_name): password = form.data.get(field_name) if (not isinstance(password, str) or not user.check_password(password)): ...
-
- Commits:
-
Summary ID b9ea0aa76462b625872027672df0d8a5acf6aec8 2604b85a568d8d71c04d59cbe89af2bd8a5a3ac8