]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
manage: Check Django version on startup
authorStephen Finucane <stephen@that.guru>
Fri, 30 Sep 2022 13:04:19 +0000 (14:04 +0100)
committerStephen Finucane <stephen@that.guru>
Fri, 30 Sep 2022 16:38:54 +0000 (17:38 +0100)
This was recently reported as an issue. Add a simple check to ensure
people update their dependencies as expected.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Cc: Siddhesh Poyarekar <sipoyare@redhat.com>
Cc: DJ Delorie <dj@redhat.com>
Cc: Carlos O'Donell <carlos@redhat.com>
manage.py
releasenotes/notes/check-django-on-startup-332acc16e7e8be8b.yaml [new file with mode: 0644]

index 033c8ae4e57027768b82fb6e3bedd0d7607fd463..d94e61187318099dc754c9453c38f1fdc9868c05 100755 (executable)
--- a/manage.py
+++ b/manage.py
@@ -7,6 +7,11 @@ if __name__ == "__main__":
         "DJANGO_SETTINGS_MODULE", "patchwork.settings.production"
     )
 
+    import django
+
+    if django.VERSION < (3, 2):
+        raise Exception('Patchwork requires Django 3.2 or greater')
+
     from django.core.management import execute_from_command_line
 
     execute_from_command_line(sys.argv)
diff --git a/releasenotes/notes/check-django-on-startup-332acc16e7e8be8b.yaml b/releasenotes/notes/check-django-on-startup-332acc16e7e8be8b.yaml
new file mode 100644 (file)
index 0000000..1211852
--- /dev/null
@@ -0,0 +1,6 @@
+---
+features:
+  - |
+    The version of Django used is now checked on start-up. This can help avoid
+    issues where deployers forget to update their Django version and see odd
+    behavior as a result.