Project can't chain tasks to itself

This commit is contained in:
simon987
2019-02-25 19:12:08 -05:00
parent df7f91a475
commit b2fcf6fce4
3 changed files with 18 additions and 14 deletions

View File

@@ -157,7 +157,7 @@ type UpdateProjectRequest struct {
SubmitRate rate.Limit `json:"submit_rate"`
}
func (req *UpdateProjectRequest) isValid() bool {
func (req *UpdateProjectRequest) isValid(pid int64) bool {
if len(req.Name) <= 0 {
return false
}
@@ -167,6 +167,9 @@ func (req *UpdateProjectRequest) isValid() bool {
if req.Hidden && req.Public {
return false
}
if req.Chain == pid {
return false
}
return true
}