Allow admin to repull a job
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
67a99a5f0d
commit
716fa6cb48
@ -350,9 +350,10 @@ func repositoryHandler(c *gin.Context) {
|
||||
}
|
||||
|
||||
func TriggerTagUpdate(c *gin.Context, work *Work, repo *Repository, u *User, tag *string) {
|
||||
loggeduser := c.MustGet("LoggedUser").(*User)
|
||||
now := time.Now()
|
||||
|
||||
if !work.Shown || work.Corrected || work.StartAvailability.After(now) || work.EndAvailability.Add(time.Hour).Before(now) {
|
||||
if !loggeduser.IsAdmin && (!work.Shown || work.Corrected || work.StartAvailability.After(now) || work.EndAvailability.Add(time.Hour).Before(now)) {
|
||||
c.AbortWithStatusJSON(http.StatusForbidden, gin.H{"errmsg": "The submission is closed."})
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user