Mercurial > gemma
comparison pkg/controllers/importqueue.go @ 3776:6521c962a7b6
Add 'cc' parameter to search imports for a comma separated list of country codes for the the importing person.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 02 Jul 2019 16:44:04 +0200 |
parents | 4c254651d80b |
children | 80bdcd137a1d |
comparison
equal
deleted
inserted
replaced
3775:33fa76994b8a | 3776:6521c962a7b6 |
---|---|
110 cond(` (kind ILIKE $%d OR username ILIKE $%d OR signer ILIKE $%d OR `+ | 110 cond(` (kind ILIKE $%d OR username ILIKE $%d OR signer ILIKE $%d OR `+ |
111 `id IN (SELECT import_id FROM import.import_logs WHERE msg ILIKE $%d)) `, | 111 `id IN (SELECT import_id FROM import.import_logs WHERE msg ILIKE $%d)) `, |
112 query, query, query, query) | 112 query, query, query, query) |
113 } | 113 } |
114 | 114 |
115 if cc := req.FormValue("cc"); cc != "" { | |
116 codes := sliceToTextArray(splitUpper(cc)) | |
117 cond(" username IN "+ | |
118 "(SELECT username FROM internal.user_profiles "+ | |
119 "WHERE country = ANY($%d)) ", | |
120 codes) | |
121 } | |
122 | |
115 if st := req.FormValue("states"); st != "" { | 123 if st := req.FormValue("states"); st != "" { |
116 states := toTextArray(st, imports.ImportStateNames) | 124 states := toTextArray(st, imports.ImportStateNames) |
117 cond(" state = ANY($%d) ", states) | 125 cond(" state = ANY($%d) ", states) |
118 } | 126 } |
119 | 127 |