Skip to content

Commit

Permalink
fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
wizard-xie committed Jul 22, 2021
1 parent a4b72cd commit 03bde77
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions conf/email-template/find-password-verification-code.tmpl
@@ -1,8 +1,8 @@
Dear user,

We have received your request to retrieve the password of the corporate manager account {{.Email}}.
your verification code is:
We have received your request to retrieve the password of the corporation manager account.
the verification code is:

{{.Code}}

Please make sure that the retrieve password is what you are doing. If not, please ignore.
Please make sure that this operation is what you are doing. If not, please ignore.
10 changes: 5 additions & 5 deletions controllers/corporation-manager.go
Expand Up @@ -94,7 +94,7 @@ func (this *CorporationManagerController) Put() {
}

// @Title Patch
// @Description reset password of corporation administrator
// @Description reset password of corporation manager
// @Success 204 {int} map
// @Failure util.ErrInvalidAccountOrPw
// @router / [patch]
Expand Down Expand Up @@ -128,11 +128,11 @@ func (this *CorporationManagerController) Patch() {
}

//@Title Retrieve password
//@Description retrieve password of corporation administrator
//@Param body body models.CorporationManagerRetrievePassword true "param of retrieve pwd"
//@Description retrieve password of corporation manager
//@Param body body models.CorporationManagerRetrievePassword true "param of retrieving password"
//@Success 201 {int} map
//@Failure 400 util.ErrInvalidAccountOrPwd
//@router /retrieve [post]
//@Failure 400 util.ErrInvalidAccountOrPw
//@router /retrieve_pw [post]
func (this *CorporationManagerController) RetrievePassword() {
action := "retrieve password"
sendResp := this.newFuncForSendingFailedResp(action)
Expand Down
2 changes: 1 addition & 1 deletion email/template.go
Expand Up @@ -64,7 +64,7 @@ func findTmpl(name string) *template.Template {
func genEmailMsg(tmplName string, data interface{}) (*EmailMessage, error) {
tmpl := findTmpl(tmplName)
if tmpl == nil {
return nil, fmt.Errorf("Failed to generate email msg: didn't find msg template: %s", tmplName)
return nil, fmt.Errorf("failed to generate email msg: didn't find msg template: %s", tmplName)
}

str, err := util.RenderTemplate(tmpl, data)
Expand Down
2 changes: 1 addition & 1 deletion routers/commentsRouter_controllers.go
Expand Up @@ -118,7 +118,7 @@ func init() {
beego.GlobalControllerRouter["github.com/opensourceways/app-cla-server/controllers:CorporationManagerController"] = append(beego.GlobalControllerRouter["github.com/opensourceways/app-cla-server/controllers:CorporationManagerController"],
beego.ControllerComments{
Method: "RetrievePassword",
Router: "/retrieve",
Router: "/retrieve_pw",
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Filters: nil,
Expand Down
2 changes: 1 addition & 1 deletion util/util.go
Expand Up @@ -75,7 +75,7 @@ func NewTemplate(name, path string) (*template.Template, error) {
func RenderTemplate(tmpl *template.Template, data interface{}) (string, error) {
buf := new(bytes.Buffer)
if err := tmpl.Execute(buf, data); err != nil {
return "", fmt.Errorf("Failed to execute template(%s): %s", tmpl.Name(), err.Error())
return "", fmt.Errorf("failed to execute template(%s): %s", tmpl.Name(), err.Error())
}

return buf.String(), nil
Expand Down

0 comments on commit 03bde77

Please sign in to comment.