Skip to content

Commit

Permalink
chore: warn about existing core config overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
smotornyuk committed Jul 7, 2023
1 parent 91c9b7b commit f0d1519
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ckanext/editable_config/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import logging
import os
from typing import Iterable

import sqlalchemy as sa

Expand Down Expand Up @@ -79,4 +80,16 @@ def configure(self, config_: CKANConfig):
)
return

stmt = sa.select(model.SystemInfo.key)
legacy_modified: Iterable[str] = model.Session.scalars(stmt)
editable = {
str(op) for op in cd.iter_options() if cd[op].has_flag(Flag.editable)
}

if problems := (set(legacy_modified) & editable):
log.warning(
"Modification via core AdminUI will produce undefined behavior: %s",
problems,
)

shared.apply_config_overrides()

0 comments on commit f0d1519

Please # to comment.