-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix orgnization user watch repository #2670
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2670 +/- ##
=======================================
Coverage 27.38% 27.38%
=======================================
Files 86 86
Lines 17010 17010
=======================================
Hits 4658 4658
Misses 11673 11673
Partials 679 679
Continue to review full report at Codecov.
|
Does user creating repository for organization need to be added automatically as watcher? |
@@ -1295,7 +1295,7 @@ func createRepository(e *xorm.Session, doer, u *User, repo *Repository) (err err | |||
} | |||
} | |||
|
|||
if err = watchRepo(e, u.ID, repo.ID, true); err != nil { | |||
if err = watchRepo(e, doer.ID, repo.ID, true); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to update other call to watchRepo(..)
on line 1483
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
models/migrations/migrations.go
Outdated
@@ -140,6 +140,8 @@ var migrations = []Migration{ | |||
NewMigration("remove duplicate unit types", removeDuplicateUnitTypes), | |||
// v45 -> v46 | |||
NewMigration("remove index column from repo_unit table", removeIndexColumnFromRepoUnitTable), | |||
// v46 -> v47 | |||
NewMigration("remove orgnization watch repositories", removeOrgnizationWatchRepo), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spelling (orgnization -> organization), both the comment and function name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
@lafriks I think yes. |
2704c80
to
d7ca9f7
Compare
LGTM Would it be worth changing |
@ethantkoenig Good idea. But for keeping the PR simple, I think that could be another PR. |
models/migrations/v46.go
Outdated
|
||
func removeOrganizationWatchRepo(x *xorm.Engine) error { | ||
// Watch is connection request for receiving repository notification. | ||
type Watch struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used, can be removed.
d7ca9f7
to
6e6f29d
Compare
@Morlinest fixed and rebased. |
LGTM |
fix #2667