Пользователи: цвет при создании и редактировании

This commit is contained in:
dev
2026-11-28 12:34:15 +03:00
parent cde281fd89
commit c9d477b6c5
8 changed files with 79 additions and 14 deletions
+2
View File
@@ -1,4 +1,5 @@
const { normalizeStudentStatus } = require('./lib/students');
const { normalizeUserColor } = require('./lib/users');
const PHOTO_JOB_ACTIONS = new Set(['ai', 'ai_face', 'ai_upscale', 'enhance', 'restore', 'rollback']);
const LESSON_REPORT_TEXT_MAX = 5000;
const LESSON_REPORT_TOPIC_MAX = 300;
@@ -369,6 +370,7 @@ function normalizeRestoreData(data) {
password_hash: reqStr(x.password_hash, 255),
name: optStr(x.name, 150),
avatar: optUploadPath(x.avatar, 255),
color: normalizeUserColor(x.color),
role: (x.role === 'admin' || x.role === 'tutor') ? x.role : 'tutor',
is_active: !!x.is_active,
created_at: optTs(x.created_at),