Fix default setting (#740)

* push validate/defaults into datastore

we weren't setting a timestamp in route insert when we needed to create an app
there. that whole thing isn't atomic, but this fixes the timestamp issue.

closes #738

seems like we should do similar with the FireBeforeX stuff too.

* fix tests

* app name validation was buggy, an upper cased letter failed. now it doesn't.
uses unicode now.
* removes duplicate errors for datastore and models validation that were used
interchangably but weren't.
This commit is contained in:
Reed Allman
2018-02-05 11:54:09 -08:00
committed by GitHub
parent b49f332e01
commit 235cbc2d67
6 changed files with 37 additions and 55 deletions

View File

@@ -28,12 +28,6 @@ func (s *Server) handleAppCreate(c *gin.Context) {
return
}
app.SetDefaults()
if err = app.Validate(); err != nil {
handleErrorResponse(c, err)
return
}
err = s.FireBeforeAppCreate(ctx, app)
if err != nil {
handleErrorResponse(c, err)