Skip to content

Commit

Permalink
Don't hardcode user watching new repository.
Browse files Browse the repository at this point in the history
The subscriber should be whoever created the new repository.

Improve error text by adding a verb.
  • Loading branch information
dmitshur committed Oct 14, 2018
1 parent 0a742a4 commit 3b88257
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions action.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (s *codeService) CreateRepo(ctx context.Context, repoSpec, repoDescription
}

// Watch the newly created repository.
err = s.notifications.Subscribe(ctx, notifications.RepoSpec{URI: repoSpec}, "", 0, []users.UserSpec{shurcool})
err = s.notifications.Subscribe(ctx, notifications.RepoSpec{URI: repoSpec}, "", 0, []users.UserSpec{currentUser.UserSpec})
if err != nil {
return err
}
Expand All @@ -138,7 +138,7 @@ func (s *codeService) CreateRepo(ctx context.Context, repoSpec, repoDescription
func getSingleValue(form url.Values, key string) (string, error) {
v, ok := form[key]
if !ok {
return "", fmt.Errorf("key %q not set", key)
return "", fmt.Errorf("key %q is not set", key)
}
if len(v) != 1 {
return "", fmt.Errorf("key %q has non-single value: %+v", key, v)
Expand Down

0 comments on commit 3b88257

Please sign in to comment.