Explorar el Código

empty invite kind -> developer

Alexander Belanger hace 5 años
padre
commit
82e51bef45
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  1. 7 1
      server/api/invite_handler.go

+ 7 - 1
server/api/invite_handler.go

@@ -203,11 +203,17 @@ func (app *App) HandleAcceptInvite(w http.ResponseWriter, r *http.Request) {
 		return
 		return
 	}
 	}
 
 
+	kind := invite.Kind
+
+	if kind == "" {
+		kind = models.RoleDeveloper
+	}
+
 	// create a new Role with the user as the admin
 	// create a new Role with the user as the admin
 	_, err = app.Repo.Project.CreateProjectRole(projModel, &models.Role{
 	_, err = app.Repo.Project.CreateProjectRole(projModel, &models.Role{
 		UserID:    userID,
 		UserID:    userID,
 		ProjectID: uint(projID),
 		ProjectID: uint(projID),
-		Kind:      invite.Kind,
+		Kind:      kind,
 	})
 	})
 
 
 	if err != nil {
 	if err != nil {