Skip to content

Commit 3dcb219

Browse files
authored
ensure external_id is unique (#1696)
1 parent b552ebd commit 3dcb219

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/controllers/github.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,8 @@ func (d DiggerController) GithubAppCallbackPage(c *gin.Context) {
10851085
if link == nil {
10861086
log.Printf("Failed to find GithubAppInstallationLink create a link and an org %v", installationId)
10871087
name := fmt.Sprintf("dggr-def-%v", uuid.NewString()[:8])
1088-
org, err := models.DB.CreateOrganisation(name, "digger", "digger")
1088+
externalId := uuid.NewString()
1089+
org, err := models.DB.CreateOrganisation(name, "digger", externalId)
10891090
if err != nil {
10901091
log.Printf("Error with CreateOrganisation: %v", err)
10911092
c.JSON(http.StatusInternalServerError, gin.H{"error": "Error with CreateOrganisation"})

0 commit comments

Comments
 (0)