Skip to content

Commit

Permalink
Removed a stray debug and minor improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
nishchayp committed Dec 20, 2017
1 parent 5d4b08e commit 4a4747d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func Options(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {

var admin Admin

if DB.db.Debug().Where("email = ?", googTok.Email).First(&admin).RecordNotFound() {
if DB.db.Where("email = ?", googTok.Email).First(&admin).RecordNotFound() {
http.Redirect(w, r, "/", 302)
} else {
var adminTemplate *template.Template
Expand Down Expand Up @@ -156,8 +156,7 @@ func MakeAccessRequest(w http.ResponseWriter, r *http.Request, _ httprouter.Para
var accessRequest AccessRequest

// register new request if it does not already exists
notFoundErr := DB.db.Where("email = ?", googTok.Email).First(&accessRequest).Error
if notFoundErr != nil {
if DB.db.Where("email = ?", googTok.Email).First(&accessRequest).RecordNotFound() == true {
accessRequest = AccessRequest{
Name: googTok.Name,
Email: googTok.Email,
Expand Down

0 comments on commit 4a4747d

Please sign in to comment.