     (if (badge-owner? ctx user-badge-id user-id)
       (throw+ {:status "error" :message "User cannot endorse himself"})
       (when-let [id (->> (insert-user-badge-endorsement<! {:user_badge_id user-badge-id
-                                                           :external_id (external-id)
+                                                           :external_id (generate-external-id)
                                                            :endorser_id user-id
                                                            :content content} (get-db ctx))
                          :generated_key)]

(defn delete! [ctx user-badge-id endorsement-id user-id]
  (try+
    (if (or (endorsement-owner? ctx endorsement-id user-id) (badge-owner? ctx user-badge-id user-id ))
      (do (delete-user-badge-endorsement! {:id endorsement-id} (get-db ctx))
        {:status "success"})
      {:status "error"}
      )

      (update-endorsement-status! {:id endorsement-id :status status} (get-db ctx))
      (case status
        "accepted" (send-badge-info-to-obf ctx user-badge-id user-id)
        "declined" (delete! ctx user-badge-id endorsement-id user-id)
        nil)
      {:status "success"})
    (catch Object _
      (log/error _)
