mirror of
https://github.com/django/django.git
synced 2025-06-05 11:39:13 +00:00
parent
ab148c02ce
commit
8df5ce80d2
@ -18,11 +18,6 @@ max_line_length = 88
|
||||
[*.html]
|
||||
indent_size = 2
|
||||
|
||||
# The JSON files contain newlines inconsistently
|
||||
[*.json]
|
||||
indent_size = 2
|
||||
insert_final_newline = ignore
|
||||
|
||||
[**/admin/js/vendor/**]
|
||||
indent_style = ignore
|
||||
indent_size = ignore
|
||||
|
@ -39,7 +39,6 @@ class Serializer(PythonSerializer):
|
||||
if self.options.get("indent"):
|
||||
self.stream.write("\n")
|
||||
self.stream.write("]")
|
||||
if self.options.get("indent"):
|
||||
self.stream.write("\n")
|
||||
|
||||
def end_object(self, obj):
|
||||
|
@ -293,7 +293,8 @@ of each library are the first to add or confirm compatibility with Python 3.12:
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
* ...
|
||||
* The :ref:`JSON <serialization-formats-json>` serializer now writes a newline
|
||||
at the end of the output, even without the ``indent`` option set.
|
||||
|
||||
.. _deprecated-features-6.0:
|
||||
|
||||
|
@ -489,7 +489,8 @@ class SerializerAPITests(SimpleTestCase):
|
||||
self.assertIs(serializer.stream_class, File)
|
||||
self.assertIsInstance(serializer.stream, File)
|
||||
self.assertEqual(
|
||||
data, '[{"model": "serializers.score", "pk": 1, "fields": {"score": 3.4}}]'
|
||||
data,
|
||||
'[{"model": "serializers.score", "pk": 1, "fields": {"score": 3.4}}]\n',
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user