Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
0a37ea56
Kaydet (Commit)
0a37ea56
authored
Ock 30, 2018
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #29091 -- Fixed makemigrations crash if migrations directory doesn't have __init__.py.
Regression in
aadd3aeb
.
üst
de59132a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
1 deletion
+11
-1
questioner.py
django/db/migrations/questioner.py
+1
-1
2.0.2.txt
docs/releases/2.0.2.txt
+3
-0
test_commands.py
tests/migrations/test_commands.py
+7
-0
.gitkeep
tests/migrations/test_migrations_no_init/.gitkeep
+0
-0
No files found.
django/db/migrations/questioner.py
Dosyayı görüntüle @
0a37ea56
...
...
@@ -48,7 +48,7 @@ class MigrationQuestioner:
elif
hasattr
(
migrations_module
,
"__path__"
):
if
len
(
migrations_module
.
__path__
)
>
1
:
return
False
filenames
=
os
.
listdir
(
migrations_module
.
__path__
[
0
])
filenames
=
os
.
listdir
(
list
(
migrations_module
.
__path__
)
[
0
])
return
not
any
(
x
.
endswith
(
".py"
)
for
x
in
filenames
if
x
!=
"__init__.py"
)
def
ask_not_null_addition
(
self
,
field_name
,
model_name
):
...
...
docs/releases/2.0.2.txt
Dosyayı görüntüle @
0a37ea56
...
...
@@ -24,3 +24,6 @@ Bugfixes
* Fixed a regression where ``contrib.auth.authenticate()`` crashes if an
authentication backend doesn't accept ``request`` and a later one does
(:ticket:`29071`).
* Fixed a regression where ``makemigrations`` crashes if a migrations directory
doesn't have an ``__init__.py`` file (:ticket:`29091`).
tests/migrations/test_commands.py
Dosyayı görüntüle @
0a37ea56
...
...
@@ -853,6 +853,13 @@ class MakeMigrationsTests(MigrationTestBase):
call_command
(
"makemigrations"
,
stdout
=
out
)
self
.
assertIn
(
"0001_initial.py"
,
out
.
getvalue
())
def
test_makemigrations_no_init
(
self
):
"""Migration directories without an __init__.py file are allowed."""
out
=
io
.
StringIO
()
with
self
.
temporary_migration_module
(
module
=
'migrations.test_migrations_no_init'
):
call_command
(
'makemigrations'
,
stdout
=
out
)
self
.
assertIn
(
'0001_initial.py'
,
out
.
getvalue
())
def
test_makemigrations_migrations_announce
(
self
):
"""
makemigrations announces the migration at the default verbosity level.
...
...
tests/migrations/test_migrations_no_init/.gitkeep
0 → 100644
Dosyayı görüntüle @
0a37ea56
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment