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
7a259008
Kaydet (Commit)
7a259008
authored
Eyl 05, 2014
tarafından
Andrew Godwin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #22411: Throw a more helpful error if contenttypes doesn't exist.
üst
62939aba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
models.py
django/contrib/contenttypes/models.py
+6
-0
No files found.
django/contrib/contenttypes/models.py
Dosyayı görüntüle @
7a259008
...
...
@@ -2,6 +2,7 @@ from __future__ import unicode_literals
from
django.apps
import
apps
from
django.db
import
models
from
django.db.utils
import
OperationalError
,
ProgrammingError
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.encoding
import
smart_text
,
force_text
from
django.utils.encoding
import
python_2_unicode_compatible
...
...
@@ -50,6 +51,11 @@ class ContentTypeManager(models.Manager):
# We start with get() and not get_or_create() in order to use
# the db_for_read (see #20401).
ct
=
self
.
get
(
app_label
=
opts
.
app_label
,
model
=
opts
.
model_name
)
except
(
OperationalError
,
ProgrammingError
):
# It's possible to migrate a single app before contenttypes,
# as it's not a required initial dependency (it's contrib!)
# Have a nice error for this.
raise
RuntimeError
(
"Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually."
)
except
self
.
model
.
DoesNotExist
:
# Not found in the database; we proceed to create it. This time we
# use get_or_create to take care of any race conditions.
...
...
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