Skip to content

Commit 8b31d49

Browse files
committed
again
1 parent 0026c6e commit 8b31d49

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

coderd/templates.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -630,16 +630,15 @@ func (api *API) patchTemplateMeta(rw http.ResponseWriter, r *http.Request) {
630630
if req.TimeTilDormantAutoDeleteMillis < 0 || (req.TimeTilDormantAutoDeleteMillis > 0 && req.TimeTilDormantAutoDeleteMillis < minTTL) {
631631
validErrs = append(validErrs, codersdk.ValidationError{Field: "time_til_dormant_autodelete_ms", Detail: "Value must be at least one minute."})
632632
}
633+
maxPortShareLevel := template.MaxPortSharingLevel
633634
if req.MaxPortSharingLevel != nil {
634635
if *req.MaxPortSharingLevel < 0 || *req.MaxPortSharingLevel > 2 {
635636
validErrs = append(validErrs, codersdk.ValidationError{Field: "max_port_sharing_level", Detail: "Value must be between 0 and 2."})
636637
}
637638
if !portSharer.CanRestrictSharing() {
638639
validErrs = append(validErrs, codersdk.ValidationError{Field: "max_port_sharing_level", Detail: "Restricting port sharing level is an enterprise feature that is not enabled."})
639640
}
640-
}
641-
maxPortShareLevel := template.MaxPortSharingLevel
642-
if req.MaxPortSharingLevel != nil {
641+
643642
maxPortShareLevel = *req.MaxPortSharingLevel
644643
}
645644

0 commit comments

Comments
 (0)