mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-14 15:29:02 +00:00
Project can't chain tasks to itself
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user