diff --git a/db/garanti/mk b/db/garanti/mk new file mode 100755 index 0000000000000000000000000000000000000000..0fe740212a3a747250899b9be5cb6f34106f4d80 --- /dev/null +++ b/db/garanti/mk @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +from dataclasses import dataclass + +import mo.csv + +@dataclass +class Garant(mo.csv.Row): + kod_oblasti: str = "" + jmeno: str = "" + email: str = "" + +f = open('garanti.csv') +rows = mo.csv.read(f, mo.csv.FileFormat.en_csv, Garant) + +for g in rows: + print(f'bin/create-user --org --mail {g.email} {g.jmeno}') + +for g in rows: + if len(g.kod_oblasti) == 1: + role = 'garant_kraj' + else: + role = 'garant_okres' + print(f'bin/add-role --email {g.email} --role {role} --place {g.kod_oblasti} --cat Z')