         new-blog (assoc db-object :draft false :id id)]
     (if (and (not= nil db-object) (own? user db-object))
       (-> new-blog
+          (transform-fields-using from-user-to-db-transform)
           (generate-title)
           (generate-seo-id id)
-          (transform-fields-using from-user-to-db-transform)
           (generate-publication-date)
           (insert-and-return db-object))
       (error "Db object deleted or not own. Refusing to update: " user new-blog id))))

        db-object (find-blog-object id)]
    (if (and (not= nil db-object) (own? user db-object))
      (-> (merge db-object new-draft)
          (generate-title)
          (transform-fields-using from-user-to-db-transform)
          (insert-and-return db-object))
      (error "Db object deleted or not own. Refusing to update: " user params id))))


               (pad-with padding)))))

(defn generate-title [blog]
  (when blog
    (if (and (-> blog :title string?) (> (-> blog :title count) 1))
      blog
      (let [b (:body blog)
            sentences (clojure.string/split b #"\.")]
        (assoc blog :title (truncate (first sentences) 150))))))

(defn create-new-draft [user]
  (id-to-sid
