WIP: django-3.2-compat #3

Draft
slamora wants to merge 8 commits from django-3.2-compat into main
Collaborator

TODO upgrading to Django 3.2.X

{% extends "admin/login.html" %}

ERROR

Internal Server Error: /admin/login/
Traceback (most recent call last):
  File "panel/env/lib/python3.8/site-packages/django/forms/forms.py", line 153, in __getitem__
    field = self.fields[name]
KeyError: 'this_is_the_login_form'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "panel/env/lib/python3.8/site-packages/django/template/base.py", line 829, in _resolve_lookup
    current = current[bit]
  File "panel/env/lib/python3.8/site-packages/django/forms/forms.py", line 155, in __getitem__
    raise KeyError(
KeyError: "Key 'this_is_the_login_form' not found in 'AdminAuthenticationForm'. Choices are: password, username."

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "panel/env/lib/python3.8/site-packages/django/template/base.py", line 837, in _resolve_lookup
    current = getattr(current, bit)
AttributeError: 'AdminAuthenticationForm' object has no attribute 'this_is_the_login_form'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "panel/env/lib/python3.8/site-packages/django/template/base.py", line 843, in _resolve_lookup
    current = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'this_is_the_login_form'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
...
  File "panel/env/lib/python3.8/site-packages/django/template/base.py", line 692, in resolve
    arg_vals.append(arg.resolve(context))
  File "panel/env/lib/python3.8/site-packages/django/template/base.py", line 796, in resolve
    value = self._resolve_lookup(context)
  File "panel/env/lib/python3.8/site-packages/django/template/base.py", line 848, in _resolve_lookup
    raise VariableDoesNotExist("Failed lookup for key "
django.template.base.VariableDoesNotExist: Failed lookup for key [this_is_the_login_form] in <AdminAuthenticationForm bound=True, valid=False, fields=(username;password)>
# TODO upgrading to Django 3.2.X - [x] Fix `ContextDecorator` --> https://docs.djangoproject.com/en/4.2/releases/3.0/#removed-private-python-2-compatibility-apis - [ ] Fix admin layout (seems broken). Check libraries that are making it "prettier". - [ ] Fix `orchestra/templates/admin/login.html` WORKAROUND, replace all code with ``` {% extends "admin/login.html" %} ``` **ERROR** ```python Internal Server Error: /admin/login/ Traceback (most recent call last): File "panel/env/lib/python3.8/site-packages/django/forms/forms.py", line 153, in __getitem__ field = self.fields[name] KeyError: 'this_is_the_login_form' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "panel/env/lib/python3.8/site-packages/django/template/base.py", line 829, in _resolve_lookup current = current[bit] File "panel/env/lib/python3.8/site-packages/django/forms/forms.py", line 155, in __getitem__ raise KeyError( KeyError: "Key 'this_is_the_login_form' not found in 'AdminAuthenticationForm'. Choices are: password, username." During handling of the above exception, another exception occurred: Traceback (most recent call last): File "panel/env/lib/python3.8/site-packages/django/template/base.py", line 837, in _resolve_lookup current = getattr(current, bit) AttributeError: 'AdminAuthenticationForm' object has no attribute 'this_is_the_login_form' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "panel/env/lib/python3.8/site-packages/django/template/base.py", line 843, in _resolve_lookup current = current[int(bit)] ValueError: invalid literal for int() with base 10: 'this_is_the_login_form' During handling of the above exception, another exception occurred: Traceback (most recent call last): ... File "panel/env/lib/python3.8/site-packages/django/template/base.py", line 692, in resolve arg_vals.append(arg.resolve(context)) File "panel/env/lib/python3.8/site-packages/django/template/base.py", line 796, in resolve value = self._resolve_lookup(context) File "panel/env/lib/python3.8/site-packages/django/template/base.py", line 848, in _resolve_lookup raise VariableDoesNotExist("Failed lookup for key " django.template.base.VariableDoesNotExist: Failed lookup for key [this_is_the_login_form] in <AdminAuthenticationForm bound=True, valid=False, fields=(username;password)> ```
slamora added 4 commits 2023-11-29 09:46:56 +00:00
Author
Collaborator

Using django-upgrade library to update some code automatically:

cd orchestra
git ls-files -z -- '*.py' | xargs -0 django-upgrade --target-version 3.2
Using [django-upgrade](https://pypi.org/project/django-upgrade/) library to update some code automatically: ``` cd orchestra git ls-files -z -- '*.py' | xargs -0 django-upgrade --target-version 3.2 ```
slamora added 35 commits 2024-01-26 13:05:46 +00:00
Copy of code in repository https://github.com/ribaguifi/django-musician
at commit d1a7ad911751e0bb5d68efa63696b1c6e2a0b47b

NOTE: there are minor changes to adapt code
Will be removed on Django 3.0
Avoid pagination inconsistency
git ls-files -z -- '*.py' | xargs -0 django-upgrade --target-version 3.2
slamora added 1 commit 2024-01-26 13:23:10 +00:00
This pull request has changes conflicting with the target branch.
  • orchestra/conf/project_template/project_name/urls.py
  • orchestra/contrib/musician/locale/ca/LC_MESSAGES/django.po
  • orchestra/contrib/musician/locale/es/LC_MESSAGES/django.po
  • orchestra/contrib/musician/templates/musician/address_list.html
  • orchestra/contrib/musician/templates/musician/mailbox_list.html
  • orchestra/contrib/musician/templates/musician/mailinglist_list.html
  • orchestra/contrib/musician/templates/musician/record_check_delete.html
  • orchestra/contrib/musician/templates/musician/saas_list.html
  • orchestra/contrib/musician/views.py
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin django-3.2-compat:django-3.2-compat
git checkout django-3.2-compat

Merge

Merge the changes and update on Forgejo.
git checkout main
git merge --no-ff django-3.2-compat
git checkout main
git merge --ff-only django-3.2-compat
git checkout django-3.2-compat
git rebase main
git checkout main
git merge --no-ff django-3.2-compat
git checkout main
git merge --squash django-3.2-compat
git checkout main
git merge --ff-only django-3.2-compat
git checkout main
git merge django-3.2-compat
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: pangea/django-orchestra#3
No description provided.