Konova Code fix
* adds command sync_codelist
* provides updating of all codes to the newest version (id)
* must be run once on staging, can be dropped afterwards since the root for the problem has been resolved on the codelist management application
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
from django.db import migrations, transaction
|
||||
|
||||
from codelist.settings import CODELIST_BIOTOPES_ID, CODELIST_AFTER_STATE_BIOTOPES__ID
|
||||
from codelist.settings import CODELIST_BIOTOPES_ID, CODELIST_AFTER_STATE_BIOTOPES_ID
|
||||
|
||||
|
||||
def migrate_biotopes_from_974_to_654(apps, schema_editor):
|
||||
@@ -23,7 +23,7 @@ def migrate_biotopes_from_974_to_654(apps, schema_editor):
|
||||
|
||||
all_states = CompensationState.objects.all()
|
||||
after_state_list_elements = all_states.filter(
|
||||
biotope_type__code_lists__in=[CODELIST_AFTER_STATE_BIOTOPES__ID]
|
||||
biotope_type__code_lists__in=[CODELIST_AFTER_STATE_BIOTOPES_ID]
|
||||
)
|
||||
if after_state_list_elements.count() > 0:
|
||||
raise Exception("Still states with wrong codelist entries!")
|
||||
|
||||
Reference in New Issue
Block a user