mirror of https://github.com/tilde-cat/register
skip not pending request when -list is used
This commit is contained in:
parent
f89567986d
commit
985f0bb56f
4
main.go
4
main.go
|
@ -8,6 +8,10 @@ type Request struct {
|
||||||
Status string
|
Status string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *Request) IsPending() bool {
|
||||||
|
return r.Status == "Pending"
|
||||||
|
}
|
||||||
|
|
||||||
func (r *Request) IsValid() bool {
|
func (r *Request) IsValid() bool {
|
||||||
return r.Username != "" &&
|
return r.Username != "" &&
|
||||||
r.Email != "" &&
|
r.Email != "" &&
|
||||||
|
|
|
@ -91,6 +91,9 @@ func getAllPendingRequests() {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if !r.IsPending() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
log.Printf("%v: %v", r.Username, pathToId(path))
|
log.Printf("%v: %v", r.Username, pathToId(path))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue