You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

v2.1.rst 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. ========================================
  2. Oscar 2.1 release notes (in development)
  3. ========================================
  4. :release: tbd
  5. Welcome to Oscar 2.1.
  6. .. contents::
  7. :local:
  8. :depth: 1
  9. .. _compatibility_of_2.1:
  10. Compatibility
  11. ~~~~~~~~~~~~~
  12. .. _new_in_2.1:
  13. What's new in Oscar 2.1?
  14. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. - The database performance of ``offer.Range.all_products()`` was substantially
  16. improved. The internals of that method have changed and specifically
  17. ``Range.invalidate_cached_ids()`` has been removed and replaced with
  18. ``Range.invalidate_cached_queryset()``.
  19. - The ``upload_to`` argument of image fields in Oscar's ``ProductImage`` and
  20. ``ProductAttributeValue`` models was changed to use a callable, so that
  21. Django doesn't generate migrations if a project modifies the ``OSCAR_IMAGE_FOLDER``
  22. to specify a custom directory structure for uploaded images.
  23. - ``catalogue.Category`` now has an ``is_public`` boolean field that serves a
  24. similar purpose to ``catalogue.Product.is_public`` - i.e., hides them from
  25. public views. The ``Category`` model also now has a custom manager
  26. that provides a ``browsable()`` queryset method that excludes non-public
  27. categories. This changes requires a database migration.
  28. Category hierarchy implies that the children of any non-public category are
  29. also non-public. This is enforced through an ``ancestors_are_public`` field
  30. on the ``Category`` model.
  31. Communications app
  32. ------------------
  33. A new ``communication`` app was introduced to provide a single point of entry
  34. for all communications sent by Oscar. This is a significant change with implications
  35. as follows:
  36. - Projects will need to add
  37. ``oscar.apps.communication.apps.CommunicationConfig`` to ``INSTALLED_APPS``.
  38. The ``CommunicationEventType``, ``Email`` and ``Notification`` models have
  39. moved from the ``customer`` app to the ``communication`` app. In order to
  40. preserve existing data, the table names for these models are unchanged.
  41. This is a change that requires database migration.
  42. - The ``Dispatcher`` class moved from ``customer.utils`` to
  43. ``communication.utils``. ``Dispatcher`` is now responsible for sending
  44. all notifications, and not just emails.
  45. - A ``CustomerDispatcher`` utility class that wraps the core ``Dispatcher``
  46. has been introduced to the ``customer`` app for sending communications to
  47. customers.
  48. - An ``AlertsDispatcher`` utility class that wraps the core ``Dispatcher``
  49. has been introduced to the ``customer.alerts`` module for sending product
  50. alerts.
  51. - An ``OrderDispatcher`` utility class that wraps the core ``Dispatcher``
  52. has been introduced to the ``order`` app for sending order related
  53. communications.
  54. - A new setting, ``OSCAR_SAVE_SENT_EMAILS_TO_DB`` controls whether emails
  55. sent through the ``Dispatcher`` are saved to the database. This defaults
  56. to ``True``.
  57. - The ability to send multipart emails with attachments was added to the new
  58. dispatcher.
  59. - All communication email templates (``commtype_*``) have moved from
  60. moved from ``customer/emails`` to ``communication/emails``.
  61. - Templates in ``customer/email/`` and ``customer/notification/`` have moved
  62. to ``communication/email/`` and ``communication/notification/``.
  63. - An ``absolute_url`` template tag was introduced to facilitate generating
  64. absolute URLs in templates for a given domain and path. The schema for
  65. generated URLs is configured via the ``OSCAR_URL_SCHEMA`` setting, which defaults
  66. to ``http``.
  67. Backwards incompatible changes in Oscar 2.1
  68. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  69. - The ``category`` field has been removed from the
  70. ``communication.Notification`` model. This change requires database migration.
  71. - The ``checkout.mixins.OrderPlacementMixin.send_confirmation_message``
  72. method has been replaced with a new ``send_order_placed_email`` method.
  73. - ``customer.notifications.context_processors.notifications`` has moved to
  74. ``communication.notifications.context_processors.notifications``.
  75. Bug fixes
  76. ~~~~~~~~~
  77. - Fixed a bug in the handling of requests to save an item in the basket for
  78. later(:issue:`3215`).
  79. - Fixed an error when deleting an offer whose related conditions/benefits have
  80. been deleted.
  81. Removal of deprecated features
  82. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  83. - Support for verifying order hashes using an insecure MD5 algorithm generated
  84. by Oscar 1.5 and below has been dropped. The ``OSCAR_DEPRECATED_ORDER_VERIFY_KEY``
  85. setting is no longer used. Order verification hashes generated by Oscar 1.5
  86. and lower will no longer validate.
  87. - ``offer.Range.contains()`` has been removed. Use ``contains_product()`` instead.
  88. - ``catalogue.managers.ProductManager`` has been removed. Use
  89. ``catalogue.managers.ProductQuerySet.as_manager()`` instead.
  90. - ``catalogue.managers.BrowsableProductManager`` has been removed. Use
  91. ``Product.objects.browsable()`` instead.
  92. - ``catalogue.Product.browsable`` has been removed. Use
  93. ``Product.objects.browsable()`` instead.
  94. - Invalid URLs supplied to ``OSCAR_DASHBOARD_NAVIGATION`` are no longer ignored.
  95. URLs that cannot be resolved will now result in a ``NoReverseMatch`` exception.
  96. URLs that are not provided by a subclass of ``oscar.core.application.OscarDashboardConfig``
  97. will result in a ``KeyError``.
  98. Minor changes
  99. ~~~~~~~~~~~~~
  100. - ``OrderPlacementMixin.place_order`` now ignores inactive vouchers when placing
  101. an order (instead of raising an exception), for consistency with how
  102. the basket flows handle inactive vouchers.
  103. - Fixed the logic of ``StockRequired.parent_availability_policy`` to use
  104. child products to determine availability of children, rather than the parent.
  105. - ``customer.forms.PasswordResetForm`` now uses the parent class' ``get_users()``
  106. method to determine the list of users to send an email to. ``get_users()``
  107. filters out users who do not currently have a usable password - which
  108. did not happen previously.
  109. This change was made in response to changes in Django to address
  110. CVE-2019-19844. Oscar's ``PasswordResetForm`` was not vulnerable to the issue
  111. in Django's form, but it was possible to send a password reset email to
  112. unintended recipients because of unicode character collision.
  113. - ``catalogue.Product.is_public`` is now an indexed field. This change requires
  114. a database migration.
  115. Dependency changes
  116. ~~~~~~~~~~~~~~~~~~
  117. - Upgraded ``django-phonenumber-field`` to use the latest in the 3.x series.
  118. - Upgraded ``select2`` to version 4.0.10.
  119. - Upgraded ``inputmask`` to version 4.0.8.
  120. .. _deprecated_features_in_2.1:
  121. Deprecated features
  122. ~~~~~~~~~~~~~~~~~~~
  123. - ``customer.alerts.utils.send_alerts`` is deprecated.
  124. Use ``AlertsDispatcher.send_alerts`` instead.
  125. - ``customer.alerts.utils.send_alert_confirmation`` is deprecated.
  126. Use ``AlertsDispatcher.send_product_alert_confirmation_email_for_user``
  127. instead.
  128. - ``customer.alerts.utils.send_product_alerts`` is deprecated.
  129. Use ``AlertsDispatcher.send_product_alert_email_for_user`` instead.
  130. - ``customer.notifications.services.notify_user`` is deprecated.
  131. Use Dispatcher.notify_user``.
  132. - ``customer.notifications.services.notify_users`` is deprecated.
  133. Use ``Dispatcher.notify_users`` instead.
  134. - ``customer.forms.PasswordResetForm.get_reset_url`` has been removed.
  135. - ``customer.views.ProfileUpdateView.form_valid`` was modified
  136. to use a new ``send_email_changed_email`` method.
  137. - ``customer.views.ChangePasswordView.form_valid`` was modified
  138. to use a new ``send_password_changed_email`` method.