10000 django-upgrade --target-version=5.0 **/*.py (#1939) · django-haystack/django-haystack@095a4a2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 095a4a2

Browse files
authored
django-upgrade --target-version=5.0 **/*.py (#1939)
* django-upgrade --target-version=5.0 **/*.py * djLint: Use HTTPS for external links.
1 parent 6264b53 commit 095a4a2

File tree

6 files changed

+11
-13
lines changed

6 files changed

+11
-13
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
exclude: ".*/vendor/.*"
22
repos:
3+
- repo: https://github.com/adamchainz/django-upgrade
4+
rev: 1.15.0
5+
hooks:
6+
- id: django-upgrade
7+
args: [--target-version, "5.0"] # Replace with Django version
8+
39
- repo: https://github.com/astral-sh/ruff-pre-commit
410
rev: v0.4.2
511
hooks:
@@ -10,10 +16,12 @@ repos:
1016
rev: 5.13.2
1117
hooks:
1218
- id: isort
19+
1320
- repo: https://github.com/psf/black
1421
rev: 24.4.2
1522
hooks:
1623
- id: black
24+
1725
- repo: https://github.com/pre-commit/pre-commit-hooks
1826
rev: v4.6.0
1927
hooks:

docs/haystack_theme/layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends "basic/layout.html" %}
22

33
{%- block extrahead %}
4-
<link rel="stylesheet" href="http://haystacksearch.org/css/front.css" media="screen">
4+
<link rel="stylesheet" href="https://haystacksearch.org/css/front.css" media="screen">
55
<link rel="stylesheet" href="_static/documentation.css" media="screen">
66
{% endblock %}
77

example_project/regular_app/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def full_name(self):
3636

3737

3838
class Toy(models.Model):
39-
dog = models.ForeignKey(Dog, related_name="toys")
39+
dog = models.ForeignKey(Dog, on_delete=models.CASCADE, related_name="toys")
4040
name = models.CharField(max_length=60)
4141

4242
def __str__(self):

haystack/__init__.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from importlib.metadata import PackageNotFoundError, version
22

3-
import django
43
from django.conf import settings
54
from django.core.exceptions import ImproperlyConfigured
65
from packaging.version import Version
@@ -17,12 +16,6 @@
1716
__version__ = "0.0.dev0"
1817
version_info = Version(__version__)
1918

20-
21-
if django.VERSION < (3, 2):
22-
# default_app_config is deprecated since django 3.2.
23-
default_app_config = "haystack.apps.HaystackConfig"
24-
25-
2619
# Help people clean up from 1.X.
2720
if hasattr(settings, "HAYSTACK_SITECONF"):
2821
raise ImproperlyConfigured(

test_haystack/core/admin.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
from .models import MockModel
66

77

8+
@admin.register(MockModel)
89
class MockModelAdmin(SearchModelAdmin):
910
haystack_connection = "solr"
1011
date_hierarchy = "pub_date"
1112
list_display = ("author", "pub_date")
12-
13-
14-
admin.site.register(MockModel, MockModelAdmin)
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
default_app_config = "test_app_using_appconfig.apps.SimpleTestAppConfig"

0 commit comments

Comments
 (0)
0