From a1f2e96afe31f4bd871c4ef8ed089f5d5bf5d09a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Tue, 10 Mar 2026 10:44:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_holiday/models/inherit_hr_leave.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py index 0c8848d4d..34115d5de 100644 --- a/yuthon_holiday/models/inherit_hr_leave.py +++ b/yuthon_holiday/models/inherit_hr_leave.py @@ -934,15 +934,15 @@ class HolidaysRequestBatch(models.Model): continue match = re.search(r'(\d+(?:\.\d+)?)', line.number_of_hours_text or '') if not match: - raise ValidationError( + raise UserError( _(f"第{line.sequence or '一'}条小时请假记录:无法提取有效小时数!")) daily_hours = float(match.group(1)) if daily_hours == 0.0: - raise ValidationError( + raise UserError( _(f"第{line.sequence or '一'}条小时请假记录:请假小时数不能为0!")) if daily_hours not in VALID_DAILY_HOURS: - raise ValidationError( + raise UserError( _(f"第{line.sequence or '一'}条小时请假记录:休假时长必须为 2、4、6 或 8 小时才可以保存!") ) leave_days = 0.0