aboutsummaryrefslogtreecommitdiffstats
path: root/services/issue/status.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/issue/status.go')
-rw-r--r--services/issue/status.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/services/issue/status.go b/services/issue/status.go
index d2b4fc303e..0da5c88762 100644
--- a/services/issue/status.go
+++ b/services/issue/status.go
@@ -7,25 +7,25 @@ package issue
import (
"context"
- "code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/db"
+ issues_model "code.gitea.io/gitea/models/issues"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/notification"
)
// ChangeStatus changes issue status to open or closed.
-func ChangeStatus(issue *models.Issue, doer *user_model.User, closed bool) error {
+func ChangeStatus(issue *issues_model.Issue, doer *user_model.User, closed bool) error {
return changeStatusCtx(db.DefaultContext, issue, doer, closed)
}
// changeStatusCtx changes issue status to open or closed.
// TODO: if context is not db.DefaultContext we get a deadlock!!!
-func changeStatusCtx(ctx context.Context, issue *models.Issue, doer *user_model.User, closed bool) error {
- comment, err := models.ChangeIssueStatus(ctx, issue, doer, closed)
+func changeStatusCtx(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, closed bool) error {
+ comment, err := issues_model.ChangeIssueStatus(ctx, issue, doer, closed)
if err != nil {
- if models.IsErrDependenciesLeft(err) && closed {
- if err := models.FinishIssueStopwatchIfPossible(ctx, doer, issue); err != nil {
+ if issues_model.IsErrDependenciesLeft(err) && closed {
+ if err := issues_model.FinishIssueStopwatchIfPossible(ctx, doer, issue); err != nil {
log.Error("Unable to stop stopwatch for issue[%d]#%d: %v", issue.ID, issue.Index, err)
}
}
@@ -33,7 +33,7 @@ func changeStatusCtx(ctx context.Context, issue *models.Issue, doer *user_model.
}
if closed {
- if err := models.FinishIssueStopwatchIfPossible(ctx, doer, issue); err != nil {
+ if err := issues_model.FinishIssueStopwatchIfPossible(ctx, doer, issue); err != nil {
return err
}
}