1. ==========================
    
  2. Django 3.1.1 release notes
    
  3. ==========================
    
  4. 
    
  5. *September 1, 2020*
    
  6. 
    
  7. Django 3.1.1 fixes two security issues and several bugs in 3.1.
    
  8. 
    
  9. CVE-2020-24583: Incorrect permissions on intermediate-level directories on Python 3.7+
    
  10. ======================================================================================
    
  11. 
    
  12. On Python 3.7+, :setting:`FILE_UPLOAD_DIRECTORY_PERMISSIONS` mode was not
    
  13. applied to intermediate-level directories created in the process of uploading
    
  14. files and to intermediate-level collected static directories when using the
    
  15. :djadmin:`collectstatic` management command.
    
  16. 
    
  17. You should review and manually fix permissions on existing intermediate-level
    
  18. directories.
    
  19. 
    
  20. CVE-2020-24584: Permission escalation in intermediate-level directories of the file system cache on Python 3.7+
    
  21. ===============================================================================================================
    
  22. 
    
  23. On Python 3.7+, the intermediate-level directories of the file system cache had
    
  24. the system's standard umask rather than ``0o077`` (no group or others
    
  25. permissions).
    
  26. 
    
  27. Bugfixes
    
  28. ========
    
  29. 
    
  30. * Fixed wrapping of translated action labels in the admin's navigation sidebar
    
  31.   for East Asian languages (:ticket:`31853`).
    
  32. 
    
  33. * Fixed wrapping of long model names in the admin's navigation sidebar
    
  34.   (:ticket:`31854`).
    
  35. 
    
  36. * Fixed encoding session data while upgrading multiple instances of the same
    
  37.   project to Django 3.1 (:ticket:`31864`).
    
  38. 
    
  39. * Adjusted admin's navigation sidebar template to reduce debug logging when
    
  40.   rendering (:ticket:`31865`).
    
  41. 
    
  42. * Fixed a data loss possibility in the
    
  43.   :meth:`~django.db.models.query.QuerySet.select_for_update()`. When using
    
  44.   related fields pointing to a proxy model in the ``of`` argument, the
    
  45.   corresponding model was not locked (:ticket:`31866`).
    
  46. 
    
  47. * Fixed a data loss possibility, following a regression in Django 2.0, when
    
  48.   copying model instances with a cached fields value (:ticket:`31863`).
    
  49. 
    
  50. * Fixed a regression in Django 3.1 that caused a crash when decoding an invalid
    
  51.   session data (:ticket:`31895`).
    
  52. 
    
  53. * Reverted a deprecation in Django 3.1 that caused a crash when passing
    
  54.   deprecated keyword arguments to a queryset in
    
  55.   ``TemplateView.get_context_data()`` (:ticket:`31877`).
    
  56. 
    
  57. * Enforced thread sensitivity of the :class:`MiddlewareMixin.process_request()
    
  58.   <django.utils.deprecation.MiddlewareMixin>` and ``process_response()`` hooks
    
  59.   when in an async context (:ticket:`31905`).
    
  60. 
    
  61. * Fixed ``__in`` lookup on key transforms for
    
  62.   :class:`~django.db.models.JSONField` with MariaDB, MySQL, Oracle, and SQLite
    
  63.   (:ticket:`31936`).
    
  64. 
    
  65. * Fixed a regression in Django 3.1 that caused permission errors in
    
  66.   ``CommonPasswordValidator`` and ``settings.py`` generated by the
    
  67.   :djadmin:`startproject` command, when user didn't have permissions to all
    
  68.   intermediate directories in a Django installation path (:ticket:`31912`).
    
  69. 
    
  70. * Fixed detecting an async ``get_response`` callable in various builtin
    
  71.   middlewares (:ticket:`31928`).
    
  72. 
    
  73. * Fixed a ``QuerySet.order_by()`` crash on PostgreSQL when ordering and
    
  74.   grouping by :class:`~django.db.models.JSONField` with a custom
    
  75.   :attr:`~django.db.models.JSONField.decoder` (:ticket:`31956`). As a
    
  76.   consequence, fetching a ``JSONField`` with raw SQL now returns a string
    
  77.   instead of preloaded data. You will need to explicitly call ``json.loads()``
    
  78.   in such cases.
    
  79. 
    
  80. * Fixed a ``QuerySet.delete()`` crash on MySQL, following a performance
    
  81.   regression in Django 3.1 on MariaDB 10.3.2+, when filtering against an
    
  82.   aggregate function (:ticket:`31965`).
    
  83. 
    
  84. * Fixed a ``django.contrib.admin.EmptyFieldListFilter`` crash when using on
    
  85.   reverse relations (:ticket:`31952`).
    
  86. 
    
  87. * Prevented content overflowing in the admin changelist view when the
    
  88.   navigation sidebar is enabled (:ticket:`31901`).