Browse Source

Revertx6 "ref: upgrade django to 4.2 (#63432) (#63601)

blocked on https://github.com/getsentry/getsentry/pull/12680

This reverts commit 13f023002ae0c047ce09cecfda2638d0734c6943.

<!-- Describe your PR here. -->
anthony sottile 1 year ago
parent
commit
3b737fa97b

+ 1 - 1
requirements-base.txt

@@ -13,7 +13,7 @@ datadog>=0.44
 django-crispy-forms>=1.14.0
 django-csp>=3.7
 django-pg-zero-downtime-migrations>=0.13
-Django>=3.2.20,<4
+Django>=4.2.8,<5
 djangorestframework>=3.14.0
 drf-spectacular>=0.26.3
 email-reply-parser>=0.5.12

+ 1 - 1
requirements-dev-frozen.txt

@@ -39,7 +39,7 @@ cssutils==2.4.0
 datadog==0.44.0
 distlib==0.3.4
 distro==1.8.0
-django==3.2.23
+django==4.2.8
 django-crispy-forms==1.14.0
 django-csp==3.7
 django-pg-zero-downtime-migrations==0.13

+ 1 - 1
requirements-frozen.txt

@@ -32,7 +32,7 @@ cssselect==1.0.3
 cssutils==2.4.0
 datadog==0.44.0
 distro==1.8.0
-django==3.2.23
+django==4.2.8
 django-crispy-forms==1.14.0
 django-csp==3.7
 django-pg-zero-downtime-migrations==0.13

+ 1 - 1
src/sentry/api/paginator.py

@@ -30,7 +30,7 @@ def count_hits(queryset, max_hits):
     # clear out any select fields (include select_related) and pull just the id
     hits_query.clear_select_clause()
     hits_query.add_fields(["id"])
-    hits_query.clear_ordering(force_empty=True)
+    hits_query.clear_ordering(force=True, clear_default=True)
     try:
         h_sql, h_params = hits_query.sql_with_params()
     except EmptyResultSet:

+ 1 - 1
src/sentry/conf/server.py

@@ -3989,7 +3989,7 @@ ngrok_host = os.environ.get("SENTRY_DEVSERVER_NGROK")
 if ngrok_host and SILO_MODE != "REGION":
     SENTRY_OPTIONS["system.url-prefix"] = f"https://{ngrok_host}"
     SENTRY_OPTIONS["system.region-api-url-template"] = ""
-    CSRF_TRUSTED_ORIGINS = [f".{ngrok_host}"]
+    CSRF_TRUSTED_ORIGINS = [f"https://*.{ngrok_host}"]
     ALLOWED_HOSTS = [f".{ngrok_host}", "localhost", "127.0.0.1", ".docker.internal"]
 
     SESSION_COOKIE_DOMAIN: str = f".{ngrok_host}"

+ 1 - 1
src/sentry/new_migrations/monkey/__init__.py

@@ -4,7 +4,7 @@ from django.db import models
 from sentry.new_migrations.monkey.executor import SentryMigrationExecutor
 from sentry.new_migrations.monkey.fields import deconstruct
 
-LAST_VERIFIED_DJANGO_VERSION = (3, 2)
+LAST_VERIFIED_DJANGO_VERSION = (4, 2)
 CHECK_MESSAGE = """Looks like you're trying to upgrade Django! Since we monkeypatch
 the Django migration library in several places, please verify that we have the latest
 code, and that the monkeypatching still works as expected. Currently the main things