Skip to content

Commit 4b85ef7

Browse files
committed
Reset reload flags
1 parent ec8c170 commit 4b85ef7

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

models/issues/issue.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,13 @@ func (issue *Issue) LoadAttributes(ctx context.Context) (err error) {
365365
return issue.loadReactions(ctx)
366366
}
367367

368+
func (issue *Issue) ResetAttributesLoaded() {
369+
issue.isLabelsLoaded = false
370+
issue.isMilestoneLoaded = false
371+
issue.isAttachmentsLoaded = false
372+
issue.isAssigneeLoaded = false
373+
}
374+
368375
// GetIsRead load the `IsRead` field of the issue
369376
func (issue *Issue) GetIsRead(ctx context.Context, userID int64) error {
370377
issueUser := &IssueUser{IssueID: issue.ID, UID: userID}

services/issue/assignee_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ func TestDeleteNotPassedAssignee(t *testing.T) {
3939
assert.NoError(t, err)
4040
assert.Empty(t, issue.Assignees)
4141

42-
// Check they're gone
42+
// Reload to check they're gone
43+
issue.ResetAttributesLoaded()
4344
assert.NoError(t, issue.LoadAssignees(db.DefaultContext))
4445
assert.Empty(t, issue.Assignees)
4546
assert.Empty(t, issue.Assignee)

0 commit comments

Comments
 (0)