MCPcopy
hub / github.com/django/django / detect_conflicts

Method detect_conflicts

django/db/migrations/loader.py:386–400  ·  view source on GitHub ↗

Look through the loaded graph and detect any conflicts - apps with more than one leaf migration. Return a dict of the app labels that conflict with the migration names that conflict.

(self)

Source from the content-addressed store, hash-verified

384 return False
385
386 def detect_conflicts(self):
387 """
388 Look through the loaded graph and detect any conflicts - apps
389 with more than one leaf migration. Return a dict of the app labels
390 that conflict with the migration names that conflict.
391 """
392 seen_apps = {}
393 conflicting_apps = set()
394 for app_label, migration_name in self.graph.leaf_nodes():
395 if app_label in seen_apps:
396 conflicting_apps.add(app_label)
397 seen_apps.setdefault(app_label, set()).add(migration_name)
398 return {
399 app_label: sorted(seen_apps[app_label]) for app_label in conflicting_apps
400 }
401
402 def project_state(self, nodes=None, at_end=True):
403 """

Callers 2

handleMethod · 0.95
handleMethod · 0.80

Calls 3

leaf_nodesMethod · 0.80
addMethod · 0.45
setdefaultMethod · 0.45

Tested by

no test coverage detected