mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[1.8.x] Revert "Fixed #24075 -- Prevented running post_migrate signals when unapplying initial migrations of contenttypes and auth"
This reverts commit737d24923a. Backport of2832a9b028from master
This commit is contained in:
@@ -5,11 +5,10 @@ import os
|
||||
import sys
|
||||
|
||||
from django.apps import apps
|
||||
from django.db import connection
|
||||
from django.db.migrations.recorder import MigrationRecorder
|
||||
from django.db.migrations.graph import MigrationGraph, NodeNotFoundError
|
||||
from django.utils import six
|
||||
from django.conf import settings
|
||||
from django.db.migrations.graph import MigrationGraph, NodeNotFoundError
|
||||
from django.db.migrations.recorder import MigrationRecorder
|
||||
from django.utils import six
|
||||
|
||||
|
||||
MIGRATIONS_MODULE_NAME = 'migrations'
|
||||
@@ -340,14 +339,3 @@ class AmbiguityError(Exception):
|
||||
Raised when more than one migration matches a name prefix
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def is_latest_migration_applied(app_label):
|
||||
# TODO: Remove when migration plan / state is passed (#24100).
|
||||
loader = MigrationLoader(connection)
|
||||
loader.load_disk()
|
||||
leaf_nodes = loader.graph.leaf_nodes(app=app_label)
|
||||
return (
|
||||
leaf_nodes and leaf_nodes[0] in loader.applied_migrations or
|
||||
app_label in loader.unmigrated_apps
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user