[PR #529] [MERGED] Upgrade to Django 4.2, try2 #537

Closed
opened 2026-02-26 10:32:05 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nsupdate-info/nsupdate.info/pull/529
Author: @ThomasWaldmann
Created: 7/11/2023
Status: Merged
Merged: 7/11/2023
Merged by: @ThomasWaldmann

Base: masterHead: django42-try2


📝 Commits (8)

  • 3dcf0ee require python >=3.8 <=3.11
  • f652751 Update to Django 4.0
  • 1554298 Update to Django 4.1
  • 095535a Update update_secret database field length for salted hash
  • 37f8734 Update to Django 4.2
  • 28a209d settings.DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
  • 75fc3a0 always use django-admin in docs, update URLs
  • c338ea2 pipenv update

📊 Changes

23 files changed (+524 additions, -455 deletions)

View changed files

📝 .github/workflows/ci.yml (+3 -3)
📝 Pipfile (+2 -2)
📝 Pipfile.lock (+378 -340)
📝 docs/admin.rst (+16 -15)
📝 requirements.d/all.txt (+1 -1)
📝 setup.py (+3 -3)
📝 src/nsupdate/accounts/models.py (+3 -2)
📝 src/nsupdate/accounts/registration_form.py (+1 -1)
📝 src/nsupdate/accounts/urls.py (+19 -19)
📝 src/nsupdate/accounts/views.py (+1 -1)
📝 src/nsupdate/login/urls.py (+15 -15)
📝 src/nsupdate/main/forms.py (+1 -1)
src/nsupdate/main/migrations/0013_alter_host_update_secret.py (+17 -0)
📝 src/nsupdate/main/models.py (+14 -4)
📝 src/nsupdate/main/urls.py (+33 -33)
📝 src/nsupdate/management/commands/domains.py (+1 -1)
📝 src/nsupdate/management/commands/faults.py (+1 -1)
📝 src/nsupdate/management/commands/hosts.py (+1 -1)
📝 src/nsupdate/management/commands/users.py (+1 -1)
📝 src/nsupdate/settings/base.py (+2 -0)

...and 3 more files

📄 Description

Could not get this working (see nsupdate.main.Host class), thus kept the deprecated code:

    class Meta(object):
        # deprecated, but works:
        unique_together = (('name', 'domain'),)
        index_together = (('name', 'domain'),)
        # this seems to be the new way, but it does not work:
        # ValueError: Found wrong number (2) of indexes for main_host(name, domain_id).
        # constraints = [models.constraints.UniqueConstraint(fields=['name', 'domain'], name='unique_host_domain')]
        # indexes = [models.Index(fields=['name', 'domain'])]

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nsupdate-info/nsupdate.info/pull/529 **Author:** [@ThomasWaldmann](https://github.com/ThomasWaldmann) **Created:** 7/11/2023 **Status:** ✅ Merged **Merged:** 7/11/2023 **Merged by:** [@ThomasWaldmann](https://github.com/ThomasWaldmann) **Base:** `master` ← **Head:** `django42-try2` --- ### 📝 Commits (8) - [`3dcf0ee`](https://github.com/nsupdate-info/nsupdate.info/commit/3dcf0ee4b9801f7878263ea44fce0cd907d76828) require python >=3.8 <=3.11 - [`f652751`](https://github.com/nsupdate-info/nsupdate.info/commit/f652751b146ba294b0d317b47f791d6f3b10c465) Update to Django 4.0 - [`1554298`](https://github.com/nsupdate-info/nsupdate.info/commit/1554298e28f5069a8ed83af9a5fe904a9b632d46) Update to Django 4.1 - [`095535a`](https://github.com/nsupdate-info/nsupdate.info/commit/095535aead425af90d322eb26e49c1154a318279) Update update_secret database field length for salted hash - [`37f8734`](https://github.com/nsupdate-info/nsupdate.info/commit/37f87342d9d758f7c98c403b40e8dd950ec6fdb2) Update to Django 4.2 - [`28a209d`](https://github.com/nsupdate-info/nsupdate.info/commit/28a209de9c0ccac57f33d433f56005bd280a2d59) settings.DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' - [`75fc3a0`](https://github.com/nsupdate-info/nsupdate.info/commit/75fc3a08c5780eb82393afd96958f32d44c0ae02) always use django-admin in docs, update URLs - [`c338ea2`](https://github.com/nsupdate-info/nsupdate.info/commit/c338ea2a5a609de136a09026e81fa0ccc18b3e66) pipenv update ### 📊 Changes **23 files changed** (+524 additions, -455 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+3 -3) 📝 `Pipfile` (+2 -2) 📝 `Pipfile.lock` (+378 -340) 📝 `docs/admin.rst` (+16 -15) 📝 `requirements.d/all.txt` (+1 -1) 📝 `setup.py` (+3 -3) 📝 `src/nsupdate/accounts/models.py` (+3 -2) 📝 `src/nsupdate/accounts/registration_form.py` (+1 -1) 📝 `src/nsupdate/accounts/urls.py` (+19 -19) 📝 `src/nsupdate/accounts/views.py` (+1 -1) 📝 `src/nsupdate/login/urls.py` (+15 -15) 📝 `src/nsupdate/main/forms.py` (+1 -1) ➕ `src/nsupdate/main/migrations/0013_alter_host_update_secret.py` (+17 -0) 📝 `src/nsupdate/main/models.py` (+14 -4) 📝 `src/nsupdate/main/urls.py` (+33 -33) 📝 `src/nsupdate/management/commands/domains.py` (+1 -1) 📝 `src/nsupdate/management/commands/faults.py` (+1 -1) 📝 `src/nsupdate/management/commands/hosts.py` (+1 -1) 📝 `src/nsupdate/management/commands/users.py` (+1 -1) 📝 `src/nsupdate/settings/base.py` (+2 -0) _...and 3 more files_ </details> ### 📄 Description Could not get this working (see nsupdate.main.Host class), thus kept the deprecated code: ``` class Meta(object): # deprecated, but works: unique_together = (('name', 'domain'),) index_together = (('name', 'domain'),) # this seems to be the new way, but it does not work: # ValueError: Found wrong number (2) of indexes for main_host(name, domain_id). # constraints = [models.constraints.UniqueConstraint(fields=['name', 'domain'], name='unique_host_domain')] # indexes = [models.Index(fields=['name', 'domain'])] ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 10:32:05 +03:00
Sign in to join this conversation.
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
starred/nsupdate.info-nsupdate-info#537
No description provided.