       (merge user (into {} [[:password (pw-kw db-id)]]))
       user)))
 
-(defn set-user-activated [username]
-  @(d/transact (conn-datomic) [{:db/id [username-kw username], activated-kw true}]))
+(defn get-user-db-entity
+  ([] (get-user-db-entity (get-logged-in-username)))
+  ([username]
+   (get-entity-from-double-vec (find-by-column-and-search-string username-kw username))))
 
+(defn set-user-activated [username] @(d/transact (conn-datomic) [{:db/id [username-kw username], activated-kw true}]))
 
 (defn account-activated [activationid]
   (let [id (find-by-column-and-search-string activated-kw activationid)]

            data (get user id)]
        (assoc field :data data)))))

(def friend-settings
  {:credential-fn             (partial creds/bcrypt-credential-fn login-user)
   :workflows                 [(workflows/interactive-form)]


(defn username-exists [username]
  (if (> (count (find-by-column-and-search-string username-kw username)) 0) true false))

(defn get-logged-in-username [] (:username (friend/current-authentication)))


(defn create-user [email password role]
