fix: skip the blank last line of a user CSV import (#31374)

This commit is contained in:
G30 2026-09-25 00:08:49 -04:00 • committed by GitHub
parent fcb0af3fd4
commit db697c7e61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -78,7 +78,7 @@
const columns = row.split(',').map((col) => col.trim());
console.debug(idx, columns);
if (idx > 0) {
if (idx > 0 && !(columns.length === 1 && columns[0] === '')) {
if (
columns.length === 4 &&
['admin', 'user', 'pending'].includes(columns[3].toLowerCase())