1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #27118 -- Made QuerySet.get_or_create()/update_or_create() error for a non-field in their arguments.

This commit is contained in:
François Freitag
2016-09-15 20:42:31 -07:00
committed by Tim Graham
parent b3330f52a8
commit a5e13a0b92
3 changed files with 47 additions and 1 deletions

View File

@@ -446,6 +446,15 @@ Protection against insecure redirects in :mod:`django.contrib.auth` and ``i18n``
and :func:`~django.views.i18n.set_language` protect users from being redirected
to non-HTTPS ``next`` URLs when the app is running over HTTPS.
``QuerySet.get_or_create()`` and ``update_or_create()`` validate arguments
--------------------------------------------------------------------------
To prevent typos from passing silently,
:meth:`~django.db.models.query.QuerySet.get_or_create` and
:meth:`~django.db.models.query.QuerySet.update_or_create` check that their
arguments are model fields. This should be backwards-incompatible only in the
fact that it might expose a bug in your project.
Miscellaneous
-------------