Browse Source

fix new team 500 (#6749)

* fix new team 500

* Update models/unit.go

Co-Authored-By: lunny <xiaolunwen@gmail.com>
tags/v1.21.12.1
Lunny Xiao GitHub 6 years ago
parent
commit
65b3f513c3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions
  1. +5
    -0
      models/unit.go
  2. +1
    -1
      templates/org/team/new.tmpl

+ 5
- 0
models/unit.go View File

@@ -25,6 +25,11 @@ const (
UnitTypeExternalTracker // 7 ExternalTracker UnitTypeExternalTracker // 7 ExternalTracker
) )


// Value returns integer value for unit type
func (u UnitType) Value() int {
return int(u)
}

func (u UnitType) String() string { func (u UnitType) String() string {
switch u { switch u {
case UnitTypeCode: case UnitTypeCode:


+ 1
- 1
templates/org/team/new.tmpl View File

@@ -57,7 +57,7 @@
{{range $t, $unit := $.Units}} {{range $t, $unit := $.Units}}
<div class="field"> <div class="field">
<div class="ui toggle checkbox"> <div class="ui toggle checkbox">
<input type="checkbox" class="hidden" name="units" value="{{$unit.Type}}"{{if or (eq $.Team.ID 0) ($.Team.UnitEnabled $unit.Type)}} checked{{end}}>
<input type="checkbox" class="hidden" name="units" value="{{$unit.Type.Value}}"{{if or (eq $.Team.ID 0) ($.Team.UnitEnabled $unit.Type)}} checked{{end}}>
<label>{{$.i18n.Tr $unit.NameKey}}</label> <label>{{$.i18n.Tr $unit.NameKey}}</label>
<span class="help">{{$.i18n.Tr $unit.DescKey}}</span> <span class="help">{{$.i18n.Tr $unit.DescKey}}</span>
</div> </div>


Loading…
Cancel
Save