Skip to content

Commit

Permalink
Fix typo in error checking
Browse files Browse the repository at this point in the history
Looks like it was propagated via cut-n-paste too. :(
  • Loading branch information
justinclift committed Oct 15, 2023
1 parent 0130183 commit 30e3d57
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions webui/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func branchNamesHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, false)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprint(w, err.Error())
return
Expand Down Expand Up @@ -1443,7 +1443,7 @@ func deleteBranchHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -1941,7 +1941,7 @@ func deleteCommitHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -2114,7 +2114,7 @@ func deleteDataHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system, and the user has write access to it
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -2225,7 +2225,7 @@ func deleteDatabaseHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprint(w, "Internal server error")
return
Expand Down Expand Up @@ -2300,7 +2300,7 @@ func deleteDatabaseHandler(w http.ResponseWriter, r *http.Request) {

// Delete the database in PostgreSQL
err = com.DeleteDatabase(dbOwner, dbName)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprint(w, "Internal server error")
log.Println(err)
Expand Down Expand Up @@ -2349,7 +2349,7 @@ func deleteReleaseHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -2430,7 +2430,7 @@ func deleteTagHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -2981,7 +2981,7 @@ func insertDataHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system, and the user has write access to it
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -4210,7 +4210,7 @@ func setDefaultBranchHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -4344,7 +4344,7 @@ func tableNamesHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, false)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -4525,7 +4525,7 @@ func tableViewHandler(w http.ResponseWriter, r *http.Request) {
// Make sure the database exists in the system, and the user has access to it
var exists bool
exists, err = com.CheckDBPermissions(loggedInUser, dbOwner, dbName, false)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -4799,7 +4799,7 @@ func updateBranchHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -4954,7 +4954,7 @@ func updateCommentHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, false) // We don't require write access since discussions are considered public
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -4995,7 +4995,7 @@ func updateDataHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system, and the user has write access to it
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -5168,7 +5168,7 @@ func updateDiscussHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, false) // We don't require write access since MRs are considered public
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprint(w, err.Error())
return
Expand Down Expand Up @@ -5261,7 +5261,7 @@ func updateReleaseHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -5375,7 +5375,7 @@ func updateTagHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down

0 comments on commit 30e3d57

Please sign in to comment.