diff options
author | Steve Manuel <nilslice@gmail.com> | 2018-01-03 14:48:20 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2018-01-03 14:48:20 -0700 |
commit | 3c8d90cf0d5e2af0a9a6adf508fffda7d636b9a6 (patch) | |
tree | 4eb1e31262907a029863a13e6fe93d89a0d0b1a8 /system | |
parent | 7b4ce4d9df4768c9bc21dabe988d1287314b9449 (diff) | |
parent | 62e38de4b127d75093afb646227ff42575228f3d (diff) |
Merge branch 'ponzu-dev' of https://github.com/ponzu-cms/ponzu into ponzu-dev
Diffstat (limited to 'system')
-rw-r--r-- | system/db/content.go | 6 | ||||
-rw-r--r-- | system/db/upload.go | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/system/db/content.go b/system/db/content.go index e73d803..b96852e 100644 --- a/system/db/content.go +++ b/system/db/content.go @@ -203,7 +203,11 @@ func insert(ns string, data url.Values) (int, error) { data.Set("id", cid) // add UUID to data for use in embedded Item - uid := uuid.NewV4() + uid, err := uuid.NewV4() + if err != nil { + return err + } + data.Set("uuid", uid.String()) // if type has a specifier, add it to data for downstream processing diff --git a/system/db/upload.go b/system/db/upload.go index beeee2d..b7171dd 100644 --- a/system/db/upload.go +++ b/system/db/upload.go @@ -28,8 +28,13 @@ func SetUpload(target string, data url.Values) (int, error) { if data.Get("uuid") == "" || data.Get("uuid") == (uuid.UUID{}).String() { + // set new UUID for upload - data.Set("uuid", uuid.NewV4().String()) + uid, err := uuid.NewV4() + if err != nil { + return 0, err + } + data.Set("uuid", uid.String()) } if data.Get("slug") == "" { |