Compare commits
No commits in common. "39d618834bf3f066544f97b4ff28e56dd42d889b" and "37586d7433969d4a06b8818338265463dd8d777e" have entirely different histories.
39d618834b
...
37586d7433
2 changed files with 1 additions and 12 deletions
|
|
@ -2,17 +2,6 @@
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
def nastav_nove_contenttypes(apps, schema_editor):
|
|
||||||
ContentType = apps.get_model('contenttypes', 'ContentType')
|
|
||||||
old_ct = ContentType.objects.filter(app_label='seminar', model='nastaveni')
|
|
||||||
# Pozn: tohle může být prázdné (pokud Django nedostalo signál o dokončených migracích, např. při vyrábění databáze z nuly)
|
|
||||||
# Ale .update to nevadí…
|
|
||||||
old_ct.update(app_label='various')
|
|
||||||
|
|
||||||
def nastav_stare_contenttypes(apps, schema_editor):
|
|
||||||
ContentType = apps.get_model('contenttypes', 'ContentType')
|
|
||||||
new_ct = ContentType.objects.filter(app_label='various', model='nastaveni')
|
|
||||||
new_ct.update(app_label='seminar')
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
|
@ -35,5 +24,4 @@ class Migration(migrations.Migration):
|
||||||
'managed': False,
|
'managed': False,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
migrations.RunPython(nastav_nove_contenttypes, nastav_stare_contenttypes),
|
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -37,4 +37,5 @@ class Migration(migrations.Migration):
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
migrations.RunPython(oprav_prava_k_nastaveni, obnov_prava_k_nastaveni),
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue