summaryrefslogtreecommitdiff
path: root/django
AgeCommit message (Collapse)Author
2021-07-23Fixed #32902 -- Fixed CsrfViewMiddleware.process_response()'s cookie reset ↵Chris Jerdonek
logic. Thanks Florian Apolloner and Shai Berger for reviews.
2021-07-22Fixed #32275 -- Added scrypt password hasher.ryowright
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-07-22Fixed #32930 -- Fixed URLValidator when port numbers < 10.Wu Haotian
2021-07-22Refs #32508 -- Raised TypeError/ValueError instead of using "assert" in ↵Mariusz Felisiak
encode() methods of some password hashers.
2021-07-22Fixed #32951 -- Removed Query.where_class & co.Nick Pope
Unused since 3caf957ed5eaa831a485abcb89f27266dbf3e82b.
2021-07-21Fixed #32949 -- Restored invalid number handling in DecimalField.validate().yakimka
DecimalField must itself validate() values, such as NaN, which cannot be passed to validators, such as MaxValueValidator, during the run_validators() phase. Regression in cc3d24d7d577f174937a0744d886c4c7123cfa85.
2021-07-20Fixed #32704 -- Fixed list of deferred fields when chaining QuerySet.defer() ↵David Wobrock
after only().
2021-07-20Fixed #32944 -- Avoided unnecessary WhereNode.add() calls.Keryn Knight
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-07-20Refs #32940 -- Removed unnecessary branch in Node.add().Keryn Knight
The "data in self.children" branch was causing data.__eq__ to be called for each entries in "self.children" which resulted in a huge slowdown during queryset construction. It's purpose was to prevent queries of the form Model.objects.filter(foo='bar').filter(foo='bar') from resulting in WHERE foo='bar' AND foo='bar' but it's not covered by the suite and has arguable performance benefits since it's not very common and SQL engines are usually very good at folding/optimizing these. See also #32632 for prior discussion around comparing data to the Node's children. Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2021-07-20Refs #32940 -- Removed Node.add()'s unused squash parameter.Keryn Knight
Unused since its introduction in d3f00bd5706b35961390d3814dd7e322ead3a9a3. Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2021-07-19Refs #10929 -- Deprecated forced empty result value for PostgreSQL aggregates.Nick Pope
This deprecates forcing a return value for ArrayAgg, JSONBAgg, and StringAgg when there are no rows in the query. Now that we have a ``default`` argument for aggregates, we want to revert to returning the default of ``None`` which most aggregate functions return and leave it up to the user to decide what they want to be returned by default.
2021-07-19Fixed #10929 -- Added default argument to aggregates.Nick Pope
Thanks to Simon Charette and Adam Johnson for the reviews.
2021-07-19Fixed #32941 -- Removed get_format_modules()'s unused reverse argument.Keryn Knight
Unused since 0d8b523422fda71baa10807d5aebefd34bad7962.
2021-07-19Removed unnecessary tuple construction in Node.__eq__().Nick Pope
2021-07-16Fixed #32655 -- Deprecated extra_tests argument for ↵Jacob Walls
DiscoverRunner.build_suite()/run_tests().
2021-07-16Fixed #32924 -- Changed BaseForm.get_initial_for_field() to remove ↵Chris Jerdonek
microseconds when needed.
2021-07-16Prevented SQLCompiler.execute_sql() from closing cursor twice.Nick Pope
cursor_iter() helper calls cursor.close() in a finally block.
2021-07-16Fixed #32928 -- Confirmed support for GDAL 3.3.David Smith
2021-07-15Fixed #32910 -- Unified different plural equations for the same language in ↵Mariusz Felisiak
contrib apps. Thanks Martin Svoboda for the report and initial patch.
2021-07-15Fixed #32929 -- Fixed handling query strings in AsyncRequestFactory.pochangl
2021-07-15Refs #32508 -- Raised Type/ValueError instead of using "assert" in ↵Daniyal
django.db.models. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-07-15Refs #32920 -- Added BoundField._has_changed() for use in ↵Chris Jerdonek
BaseForm.changed_data().
2021-07-15Fixed #32920 -- Changed BaseForm to access its values through bound fields.Chris Jerdonek
2021-07-15Fixed #32905 -- Added CSS class for non-form errors of formsets.Ties Jan Hefting
2021-07-14Fixed #21936 -- Allowed DeleteView to work with custom Forms and ↵Carlton Gibson
SuccessMessageMixin. Thanks to Mariusz Felisiak for review. Co-authored-by: Demetris Stavrou <demestav@gmail.com> Co-authored-by: Caroline Simpson <github@hoojiboo.com>
2021-07-13Simplified django.utils.dateformat methods.Nick Pope
This removes unnecessary format('O') call, remove unnecessary method calls for simple cases in TimeFormat, and simplifies time zone handling in TimeFormat.
2021-07-13Fixed #32917 -- Added BaseForm._widget_data_value()/_field_data_value().Chris Jerdonek
2021-07-13Refs #23359 -- Corrected showmigrations help text for the --database option.Wilhelm Klopp
2021-07-12Refs #32074 -- Used Enum.repr() format proposed for Python 3.10.Mariusz Felisiak
The Python's Steering Council decided to revert changes in the Enum module (see https://bugs.python.org/issue44559) and moved them to Python 3.11. Follow up to 5d9b065d3f93de056588dfee6f1776294dd8bab2. Thanks Nick Pope for the review.
2021-07-12Fixed #32914 -- Prevented test --shuffle from skipping test methods.Chris Jerdonek
"test --shuffle" skipped test methods when test classes were mixed. This changes runner.py's reorder_tests() to group by TestCase class. Regression in 90ba716bf060ee7fef79dc230b0b20644839069f.
2021-07-09Fixed #27021 -- Allowed lookup expressions in annotations, aggregations, and ↵Ian Foote
QuerySet.filter(). Thanks Hannes Ljungberg and Simon Charette for reviews. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-07-09Refs #24522 -- Fixed code comment about seeds in Shuffler.__init__().Chris Jerdonek
2021-07-08Fixed #24522 -- Added a --shuffle option to DiscoverRunner.Chris Jerdonek
2021-07-08Fixed #32908 -- Allowed select_for_update(skip_locked) on MariaDB 10.6+.Mariusz Felisiak
2021-07-07Fixed #32840 -- Optimized Field.get_col().Keryn Knight
get_col() used "self" as "output_field" when it was not given, and unnecessarily compared "self" to "self". Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-07-07Fixed inspectdb and schema tests on MariaDB 10.6+.Mariusz Felisiak
The utf8 character set (and related collations) is by default an alias for utf8mb3 on MariaDB 10.6+.
2021-07-07Fixed #32904 -- Made parse_time() more strict.abhiabhi94
Thanks Keryn Knight for the report.
2021-07-07Fixed #32866 -- Fixed trimming trailing punctuation from escaped string in ↵Shipeng Feng
urlize().
2021-07-06Fixed #32892 -- Optimized django.utils.dateparse functions by using ↵Keryn Knight
fromisoformat().
2021-07-06Fixed #32776 -- Added support for Array subqueries on PostgreSQL.Hannes Ljungberg
2021-07-05Fixed #32901 -- Optimized BaseForm.__getitem__().Chris Jerdonek
2021-07-05Refs #32508 -- Raised ImproperlyConfigured/TypeError instead of using "assert".Mateo Radman
2021-07-05Fixed #32226 -- Fixed JSON format of QuerySet.explain() on PostgreSQL.Wu Haotian
2021-07-05Refs #24121 -- Added __repr__() to AdminSite, DefaultAdminSite, and ModelAdmin.Eduardo Aldair Ahumada Garcia Jurado
Thanks tlebrize for the initial patch.
2021-07-02Fixed #30934 -- Included database alias in django.db.backends log messages.Nick Pope
This is useful when working with database routing as you want to know where each query is being executed. Co-authored-by: David Winterbottom <david.winterbottom@gmail.com>
2021-07-02Fixed #28935 -- Fixed display of errors in extended blocks.cammil
Get the template that caused the exception and get the exception info from that template, using the node that caused the exception.
2021-07-02Refs #26430 -- Re-introduced empty aggregation optimization.Simon Charette
The introduction of the Expression.empty_aggregate_value interface allows the compilation stage to enable the EmptyResultSet optimization if all the aggregates expressions implement it. This also removes unnecessary RegrCount/Count.convert_value() methods. Disabling the empty result set aggregation optimization when it wasn't appropriate prevented None returned for a Count aggregation value. Thanks Nick Pope for the review.
2021-07-02Fixed #26430 -- Fixed coalesced aggregation of empty result sets.Simon Charette
Disable the EmptyResultSet optimization when performing aggregation as it might interfere with coalescence.
2021-07-01Fixed #32893 -- Fixed serialization of models.Model class in migrations.abhiabhi94
Migrations assumed that an import of the models.Model class must already be included when it's serialized, but for models with only custom fields this was not necessarily the case. Thanks Jaap Joris Vens for the report.
2021-07-01Fixed #32889 -- Allowed per-request sync_to_async context in ASGIHandler .Allan Feldman
By using a asgiref's ThreadSensitiveContext context manager, requests will be able to execute independently of other requests when sync work is involved. Prior to this commit, a single global thread was used to execute any sync work independent of the request from which that work was scheduled. This could result in contention for the global sync thread in the case of a slow sync function. Requests are now isolated to their own sync thread.