(value any)
| 59 | } |
| 60 | |
| 61 | func (form *backupCreateForm) checkUniqueName(value any) error { |
| 62 | v, _ := value.(string) |
| 63 | if v == "" { |
| 64 | return nil // nothing to check |
| 65 | } |
| 66 | |
| 67 | fsys, err := form.app.NewBackupsFilesystem() |
| 68 | if err != nil { |
| 69 | return err |
| 70 | } |
| 71 | defer fsys.Close() |
| 72 | |
| 73 | if exists, err := fsys.Exists(v); err != nil || exists { |
| 74 | return validation.NewError("validation_backup_name_exists", "The backup file name is invalid or already exists.") |
| 75 | } |
| 76 | |
| 77 | return nil |
| 78 | } |
nothing calls this directly
no test coverage detected