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

Conversation

PIG208
Copy link
Contributor

@PIG208 PIG208 commented Jul 1, 2022

I have made things!

Made a series of changes according to the documentation and the source code of Django. References are in the commit messages.

Related issues

None

@PIG208 PIG208 force-pushed the fixes branch 2 times, most recently from 91b581a to ec66dfc Compare July 1, 2022 16:53
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>
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>
@sobolevn
Copy link
Member

sobolevn commented Jul 4, 2022

Hi! Can you please fix linter errors?

@PIG208
Copy link
Contributor Author

PIG208 commented Jul 4, 2022

Fixed!

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

@@ -202,7 +202,7 @@ class FSFilesHandler(WSGIHandler):
base_url: Any = ...
def __init__(self, application: Any) -> None: ...
def file_path(self, url: Any): ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note for future: this class can be improved further.

@sobolevn sobolevn merged commit 516deba into typeddjango:master Jul 4, 2022
PIG208 added a commit to PIG208/zulip that referenced this pull request Jul 18, 2022
This is a follow-up to typeddjango/django-stubs#1038.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
PIG208 added a commit to PIG208/zulip that referenced this pull request Jul 19, 2022
This is a follow-up to typeddjango/django-stubs#1038.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
PIG208 added a commit to PIG208/zulip that referenced this pull request Jul 19, 2022
This is a follow-up to typeddjango/django-stubs#1038.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
PIG208 added a commit to PIG208/zulip that referenced this pull request Jul 19, 2022
This is a follow-up to typeddjango/django-stubs#1038.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
PIG208 added a commit to PIG208/zulip that referenced this pull request Jul 19, 2022
This is a follow-up to typeddjango/django-stubs#1038.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
PIG208 added a commit to PIG208/zulip that referenced this pull request Jul 19, 2022
This is a follow-up to typeddjango/django-stubs#1038.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
PIG208 added a commit to PIG208/zulip that referenced this pull request Jul 21, 2022
This is a follow-up to typeddjango/django-stubs#1038.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
PIG208 added a commit to PIG208/zulip that referenced this pull request Jul 21, 2022
This is a follow-up to typeddjango/django-stubs#1038.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
PIG208 added a commit to PIG208/zulip that referenced this pull request Jul 21, 2022
This is a follow-up to typeddjango/django-stubs#1038.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
PIG208 added a commit to PIG208/zulip that referenced this pull request Jul 22, 2022
This is a follow-up to typeddjango/django-stubs#1038.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
PIG208 added a commit to PIG208/zulip that referenced this pull request Jul 22, 2022
This is a follow-up to typeddjango/django-stubs#1038.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
PIG208 added a commit to PIG208/zulip that referenced this pull request Jul 25, 2022
This is a follow-up to typeddjango/django-stubs#1038.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
timabbott pushed a commit to zulip/zulip that referenced this pull request Jul 27, 2022
This is a follow-up to typeddjango/django-stubs#1038.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
Khushiyant pushed a commit to Khushiyant/zulip that referenced this pull request Jul 29, 2022
This is a follow-up to typeddjango/django-stubs#1038.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
@PIG208 PIG208 deleted the fixes branch August 8, 2022 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants