Skip to content

Rename BaseLoginForm.get_context to avoid clash with Django internals #40

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

Merged
merged 1 commit into from
Jan 11, 2022

Conversation

amureki
Copy link
Collaborator

@amureki amureki commented Jan 10, 2022

In Django 4.0 forms.Form.get_context was introduced for passing form context in templates.
https://docs.djangoproject.com/en/4.0/ref/forms/api/#django.forms.Form.get_context

Due to this change, we have a clash, as django-mail-auth uses a function with the same name, but for different purpose:

BaseLoginForm.get_context() missing 2 required positional arguments: 'request' and 'user'

In Django 4.0 `forms.Form.get_context` was introduced for passing form context in templates.
https://docs.djangoproject.com/en/4.0/ref/forms/api/#django.forms.Form.get_context

Due to this we have a clash, as django-mail-auth uses function with the same name, but for different purpose:

```python
BaseLoginForm.get_context() missing 2 required positional arguments: 'request' and 'user'
```
@amureki amureki requested a review from codingjoe January 10, 2022 14:23
@amureki amureki self-assigned this Jan 10, 2022
@codecov
Copy link

codecov bot commented Jan 10, 2022

Codecov Report

Merging #40 (71c1252) into master (1d4c869) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #40   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines          331       331           
=========================================
  Hits           331       331           
Impacted Files Coverage Δ
mailauth/forms.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d4c869...71c1252. Read the comment docs.

@amureki amureki changed the title Renage BaseLoginForm.get_context to avoid clash with Django internals Rename BaseLoginForm.get_context to avoid clash with Django internals Jan 10, 2022
@amureki amureki merged commit d5df6a0 into master Jan 11, 2022
@amureki amureki deleted the mail-context branch January 11, 2022 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants