添加功能

This commit is contained in:
李鹏宇
2026-03-10 10:44:31 +08:00
parent 29fbc3b3ce
commit a1f2e96afe
+3 -3
View File
@@ -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