                                t
                                lookup-record))))
 
-          (let [key-value (k/extract-key-value key record)]
-            (when-let [lookup-record (create-lookup-record
-                                      uber-key uber-key-value
-                                      key key-value)]
+          (when-let [key-value (k/extract-key-value key record)]
+            (let [lookup-record (create-lookup-record
+                                 uber-key uber-key-value
+                                 key key-value)]
               [(upsert-record session model t lookup-record)]))))))))
 
 (defn upsert

                                 model
                                 record))]
             (m/return
              (re/select-one session
                             (get-in model [:primary-table :name])
                             (get-in model [:primary-table :key])
                             (t/extract-uber-key-value model record)))))))

   [qbits.alia.manifold :as aliam]
   [qbits.hayt :as h]
   [er-cassandra.key :as k]
   [er-cassandra.record-either :as r]
   [er-cassandra.model.types :as t]
   [er-cassandra.model.util :refer [combine-responses create-lookup-record]]
   [er-cassandra.model.unique-key :as uk])
