File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/country_workspace/workspaces/admin/cleaners Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 44from django .db .models import Model , QuerySet
55
66from country_workspace .models import AsyncJob , Household , Program
7+ from country_workspace .state import state
78
89if TYPE_CHECKING :
910 from country_workspace .models .base import Validable
@@ -32,11 +33,12 @@ def validate_program(job: AsyncJob) -> dict[str, int]:
3233 hh : Household
3334 try :
3435 p : Program = job .program
35- for hh in Household .objects .filter (batch__program = p ):
36- if hh .validate_with_checker ():
37- valid += 1
38- else :
39- invalid += 1
36+ with state .set (tenant = p .country_office , program = p ):
37+ for hh in Household .objects .filter (batch__program = p ):
38+ if hh .validate_with_checker ():
39+ valid += 1
40+ else :
41+ invalid += 1
4042 except Exception as e : # pragma: no cover
4143 logger .error (e )
4244 raise
You can’t perform that action at this time.
0 commit comments