Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve stubs with minor fixes #1038

Merged
merged 5 commits into from
Jul 4, 2022
Merged

Improve stubs with minor fixes #1038

merged 5 commits into from
Jul 4, 2022

Commits on Jul 1, 2022

  1. Add a missing attribute to Jinja2.

    https://github.com/django/django/blob/main/django/template/backends/jinja2.py#L35
    
    Signed-off-by: Zixuan James Li <p359101898@gmail.com>
    PIG208 committed Jul 1, 2022
    Configuration menu
    Copy the full SHA
    81f4b07 View commit details
    Browse the repository at this point in the history
  2. Make _QuerySet.extra's signature more generic.

    This makes sure that we don't reject tuples, which is also valid
    according to the implementation.
    
    Relevant source code:
    https://github.com/django/django/blob/03eec9ff6cc78e7c1bcf88bb76ecd11f0d433c72/django/db/models/sql/where.py#L271-L281
    https://github.com/django/django/blob/03eec9ff6cc78e7c1bcf88bb76ecd11f0d433c72/django/db/models/sql/query.py#L2307-L2308
    
    Signed-off-by: Zixuan James Li <p359101898@gmail.com>
    PIG208 committed Jul 1, 2022
    Configuration menu
    Copy the full SHA
    7291344 View commit details
    Browse the repository at this point in the history
  3. Fix user_passes_test to use AUTH_USER_MODEL.

    According to the documentation, `test_func` is a callable that takes a
    `User` (possibly anonymous).
    
    Relevant documentation:
    https://docs.djangoproject.com/en/4.0/topics/auth/default/#django.contrib.auth.decorators.user_passes_test
    
    Signed-off-by: Zixuan James Li <p359101898@gmail.com>
    PIG208 committed Jul 1, 2022
    Configuration menu
    Copy the full SHA
    b5cfdb1 View commit details
    Browse the repository at this point in the history
  4. Add more accurate type annotations for dirs.

    Though not documented, it's possible for `dirs` to contain
    `pathlib.Path`.
    
    `django.template.loaders.app_directories.Loader` is an example for this:
    https://github.com/django/django/blob/03eec9ff6cc78e7c1bcf88bb76ecd11f0d433c72/django/template/loaders/app_directories.py
    https://github.com/django/django/blob/03eec9ff6cc78e7c1bcf88bb76ecd11f0d433c72/django/template/utils.py#L97-L111
    
    Signed-off-by: Zixuan James Li <p359101898@gmail.com>
    PIG208 committed Jul 1, 2022
    Configuration menu
    Copy the full SHA
    71bb3f3 View commit details
    Browse the repository at this point in the history