1
0
mirror of https://github.com/django/django.git synced 2025-03-20 14:20:44 +00:00

3096 Commits

Author SHA1 Message Date
Peter Inglesby
3921b1c6d2 Refs -- Made shell ignore a missing sys.___interactivehook__.
Thanks Tim Graham for the report.

Follow up to 1bbb98d9a4b7d83e422b14ae2429cb368eff5a13.
2021-09-06 10:18:13 +02:00
Nick Pope
68b8eda788 Refs -- Added .make_key() in .touch() for dummy cache backend.
All cache operations should use make_key().
2021-09-03 10:36:14 +02:00
Daniyal Abbasi
dca4c2ff76 Refs -- Moved PickleSerializer to django.core.serializers.base and added tests. 2021-09-02 11:24:55 +02:00
Stefanos I. Tsaklidis
d0ea01af28 Fixed -- Fixed get_image_dimensions() on nonexistent images.
Thanks Nick Pope for the review.
2021-09-02 07:08:50 +02:00
sage
84c7c4a477 Fixed -- Added --exclude option to startapp/startproject management commands. 2021-09-01 12:08:02 +02:00
Jan Szoja
b667ac24ea Fixed -- Allowed suppressing base command options in --help output.
This also suppresses -verbosity and --trackback options in the
runserver's help.
2021-08-31 11:04:02 +02:00
Mariusz Felisiak
93e06f2978
Refs -- Removed unnecessary BaseMemcachedCache.decr(). 2021-08-31 10:37:59 +02:00
Sondre Lillebø Gundersen
2c912c3488 Fixed -- Fixed handling nonexistent keys with negative deltas in incr()/decr() in memcached backends.
Thanks Chris Jerdonek for the review.
2021-08-31 07:34:53 +02:00
Mariusz Felisiak
36714be874 Refs -- Fixed handling --parallel option in test management command and runtests.py.
Regression in ae89daf46f83a7b39d599d289624c3377bfa4ab1.
Thanks Tim Graham for the report.
2021-08-19 09:18:32 +02:00
qimingmafan
ee46722cb9 Fixed typo in regex for IPv6 literals in EmailValidator. 2021-08-06 12:58:55 +02:00
Jacob Walls
910ecd1b8d Fixed -- Fixed migrate crash when specifying a name of partially applied squashed migrations. 2021-08-04 09:57:32 +02:00
Jacob Walls
202d3e193a Fixed typos in migrations tests, comments, and error message. 2021-08-04 09:28:23 +02:00
David Smith
1024b5e74a Fixed 32956 -- Lowercased spelling of "web" and "web framework" where appropriate. 2021-07-29 06:24:12 +02:00
Wu Haotian
65b880b726 Fixed -- Fixed URLValidator when port numbers < 10. 2021-07-22 11:58:28 +02:00
Wilhelm Klopp
bbf93efa19
Refs -- Corrected showmigrations help text for the --database option. 2021-07-13 06:29:21 +02:00
Allan Feldman
36fa071d6e Fixed -- Allowed per-request sync_to_async context in ASGIHandler .
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.
2021-07-01 12:13:19 +02:00
Carlton Gibson
4af162d4de Refs -- Made makemessages remove temporary files on preprocessing error.
Co-authored-by: Anders Hovmöller <anders.hovmoller@dryft.se>
2021-07-01 10:11:10 +02:00
Carlton Gibson
dfa7781033 Fixed -- Made makemessages remove temporary files when locale path doesn't exist. 2021-07-01 10:11:10 +02:00
Peter Inglesby
1bbb98d9a4 Fixed -- Ensured sys.__interactivehook__ is called in shell
By default, this means that readline is properly registered, so that
.python_history is used.

sys.__interactivehook__ may be set by a $PYTHONSTARTUP file.
2021-06-23 14:53:41 +02:00
Jacob Walls
501a371411 Fixed typo in makemessages error message. 2021-06-21 21:23:59 +02:00
Jacob Walls
2dfc1066a0 Fixed -- Clarified partially recorded state of squashed migrations in showmigrations --list. 2021-06-11 09:35:42 +02:00
Chris Jerdonek
7272e1963f Fixed -- Updated os.scandir() uses to use a context manager. 2021-06-07 06:52:42 +02:00
Jacob Walls
ec2727efef Fixed -- Prevented infinite loop in FileSystemStorage.save() when a broken symlink with the same name exists. 2021-06-02 12:20:22 +02:00
Mariusz Felisiak
e1d787f1b3 Fixed CVE-2021-33571 -- Prevented leading zeros in IPv4 addresses.
validate_ipv4_address() was affected only on Python < 3.9.5, see [1].
URLValidator() uses a regular expressions and it was affected on all
Python versions.

[1] https://bugs.python.org/issue36384
2021-06-02 10:58:39 +02:00
Michael Lissner
5a8e8f80bb Fixed -- Made database cache count size once per set. 2021-05-26 11:21:11 +02:00
Carlton Gibson
c2e6047c72 Fixed -- Caught possible exception when initializing colorama. 2021-05-19 10:33:15 +02:00
Mariusz Felisiak
958cdf65ae Fixed -- Prevented initialization of unused caches.
Thanks Alexander Ebral for the report.

Regression in 98e05ccde440cc9b768952cc10bc8285f4924e1f.
2021-05-18 18:24:19 +02:00
William Schwartz
de32fe83a2 Fixed -- Refactored loaddata command to make it extensible.
Moved deeply nested blocks out of inner loops to improve readability
and maintainability.

Thanks to Mariusz Felisiak, Shreyas Ravi, and Paolo Melchiorre for
feedback.
2021-05-18 07:05:33 +02:00
William Schwartz
1557778121 Refs -- Simplified find_fixtures() in loaddata command.
This always replaces 'fixture_name' with its base name, which preserves
the previous behavior, because os.path.basename() was not called only on
relative paths without os.path.sep i.e. when base name was equal to the
file name.

This also changes os.path.dirname() and os.path.basename() calls to the
equivalent os.path.split() call.
2021-05-14 20:45:04 +02:00
William Schwartz
1e655d35ad Refs -- Cleaned up try/except blocks in loaddata command.
This moves code unable to trigger relevant exceptions outside of
try/except blocks, and changes 'objects' to 'objects_in_fixture'
which is equal to the length of 'objects'.
2021-05-14 20:45:04 +02:00
Rohith PR
530f58caaa Fixed -- Fixed validation of startapp's directory with trailing slash.
Regression in fc9566d42daf28cdaa25a5db1b5ade253ceb064f.
2021-05-14 12:45:00 +02:00
Mariusz Felisiak
b55699968f
Fixed -- Relaxed file name validation in FileField.
- Validate filename returned by FileField.upload_to() not a filename
  passed to the FileField.generate_filename() (upload_to() may
  completely ignored passed filename).
- Allow relative paths (without dot segments) in the generated filename.

Thanks to Jakub Kleň for the report and review.
Thanks to all folks for checking this patch on existing projects.
Thanks Florian Apolloner and Markus Holtermann for the discussion and
implementation idea.

Regression in 0b79eb36915d178aef5c6a7bbce71b1e76d376d3.
2021-05-13 08:53:44 +02:00
Nick Pope
d06c5b3581 Fixed -- Updated datetime module usage to recommended approach.
- Replaced datetime.utcnow() with datetime.now().
- Replaced datetime.utcfromtimestamp() with datetime.fromtimestamp().
- Replaced datetime.utctimetuple() with datetime.timetuple().
- Replaced calendar.timegm() and datetime.utctimetuple() with datetime.timestamp().
2021-05-12 11:08:41 +02:00
Hasan Ramezani
028f10fac6 Fixed -- Deprecated django.utils.baseconv module. 2021-05-07 11:57:40 +02:00
Mariusz Felisiak
e1e81aa1c4
Fixed , Fixed CVE-2021-32052 -- Prevented newlines and tabs from being accepted in URLValidator on Python 3.9.5+.
In Python 3.9.5+ urllib.parse() automatically removes ASCII newlines
and tabs from URLs [1, 2]. Unfortunately it created an issue in
the URLValidator. URLValidator uses urllib.urlsplit() and
urllib.urlunsplit() for creating a URL variant with Punycode which no
longer contains newlines and tabs in Python 3.9.5+. As a consequence,
the regular expression matched the URL (without unsafe characters) and
the source value (with unsafe characters) was considered valid.

[1] https://bugs.python.org/issue43882 and
[2] 76cd81d603
2021-05-06 08:45:23 +02:00
ecogels
a0a5e0f4c8 Fixed -- Prevented database cache backend from checking .rowcount on closed cursor.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-05-05 12:41:59 +02:00
Florian Apolloner
0b79eb3691 Fixed CVE-2021-31542 -- Tightened path & file name sanitation in file uploads. 2021-05-04 08:44:42 +02:00
Tim Graham
54da6e2ac2 Fixed -- Removed SECURE_BROWSER_XSS_FILTER setting. 2021-04-30 12:32:52 +02:00
Mariusz Felisiak
34d1905712
Fixed -- Fixed caches system check crash when STATICFILES_DIRS is a list of 2-tuples.
Thanks Jared Lockhart for the report.

Regression in c36075ac1dddfa986340b1a5e15fe48833322372.
2021-04-21 09:41:37 +02:00
Chris Jerdonek
823a9e6bac Fixed -- Made ThreadedWSGIServer close connections after each thread.
ThreadedWSGIServer is used by LiveServerTestCase.
2021-04-12 10:23:56 +02:00
bankc
db5b75f10f Fixed -- Added support for Cross-Origin Opener Policy header.
Thanks Adam Johnson and Tim Graham for the reviews.

Co-authored-by: Tim Graham <timograham@gmail.com>
2021-03-30 19:59:24 +02:00
Daniyal
474cc420bf Refs -- Raised Type/ValueError instead of using "assert" in django.core. 2021-03-19 08:04:37 +01:00
Tim Graham
dba44a7a7a Refs -- Required CSRF_TRUSTED_ORIGINS setting to include the scheme. 2021-03-18 20:00:22 +01:00
Mariusz Felisiak
ec0ff40631 Fixed -- Dropped support for Python 3.6 and 3.7 2021-02-10 10:20:54 +01:00
Josh Santos
9c6ba87692 Fixed -- Improved makemessages error message when app's locale directory doesn't exist. 2021-02-09 20:00:20 +01:00
Mikolaj Rybinski
8e90560aa8 Fixed -- Fixed detecting primary key values in deserialization when PK is also a FK. 2021-02-05 12:33:43 +01:00
Daniel Ebrahimian
3f8979e37b Fixed -- Fixed showmigrations crash for applied squashed migrations.
Thanks Simon Charette for reviews.
2021-02-04 21:17:26 +01:00
Simon Charette
f23b05696e Fixed -- Allowed capturing stdout of migration signals. 2021-02-04 11:19:49 +01:00
Timothy McCurrach
b1821fbad5 Fixed -- Added system check for FILE_UPLOAD_TEMP_DIR setting. 2021-01-22 07:51:00 +01:00
Adam Johnson
8c7ff7b8cf
Removed unreachable SystemExit check.
This check dates back to Python <2.5, before Python introduced
BaseException to prevent exactly unwarranted catching of SystemExit
(and others).

response_for_exception() is only called under `except Exception` or
`except Http404` so it's now impossible for a SystemExit instance to
reach the branch.
2021-01-19 07:04:53 +01:00