fix(AlertsReports): making log retention "None" option valid (#27554)
This commit is contained in:
parent
de82d90b9c
commit
b7f3e0bb50
|
|
@ -1622,11 +1622,7 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
|
|||
ariaLabel={t('Log retention')}
|
||||
placeholder={t('Log retention')}
|
||||
onChange={onLogRetentionChange}
|
||||
value={
|
||||
typeof currentAlert?.log_retention === 'number'
|
||||
? currentAlert?.log_retention
|
||||
: ALERT_REPORTS_DEFAULT_RETENTION
|
||||
}
|
||||
value={currentAlert?.log_retention}
|
||||
options={RETENTION_OPTIONS}
|
||||
sortComparator={propertyComparator('value')}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ class AsyncPruneReportScheduleLogCommand(BaseCommand):
|
|||
row_count = ReportScheduleDAO.bulk_delete_logs(
|
||||
report_schedule, from_date, commit=False
|
||||
)
|
||||
db.session.commit()
|
||||
logger.info(
|
||||
"Deleted %s logs for report schedule id: %s",
|
||||
str(row_count),
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ class ReportSchedulePutSchema(Schema):
|
|||
log_retention = fields.Integer(
|
||||
metadata={"description": log_retention_description, "example": 90},
|
||||
required=False,
|
||||
validate=[Range(min=1, error=_("Value must be greater than 0"))],
|
||||
validate=[Range(min=0, error=_("Value must be 0 or greater"))],
|
||||
)
|
||||
grace_period = fields.Integer(
|
||||
metadata={"description": grace_period_description, "example": 60 * 60 * 4},
|
||||
|
|
|
|||
Loading…
Reference in New Issue