       {:status "success"})
     {:status "error"}))
 
+(defn delete-badge-evidences! [db badge-id user-id]
+  (if-let [evidences (select-user-badge-evidence {:user_badge_id badge-id} db)]
+    (when-not (empty? evidences)
+        (delete-all-badge-evidences! {:user_badge_id badge-id} db)
+        (doseq [evidence evidences
+                :let [name (str "evidence_id:"(:id evidence))]]
+          (delete-user-evidence-property! {:name name :user_id user-id} db)))))
 
 (defn delete-badge-with-db! [db user-badge-id]
   (delete-badge-tags! {:user_badge_id user-badge-id} db)

    (if (badge-owner? ctx user-badge-id user-id)
      (let [data {:id          user-badge-id
                  :visibility   visibility
                  :rating       rating}]
        (if (and (private? ctx) (= "public" visibility))
          (throw+ {:status "error" :user-badge-id user-badge-id :user-id user-id :message "trying save badge visibilty as public in private mode"}) )
        (update-badge-settings! data (u/get-db ctx))
        (save-badge-tags! ctx tags user-badge-id)
        (send-badge-info-to-obf ctx user-badge-id user-id)
        (badge-publish-update! ctx user-badge-id visibility)
        (if (or (= "internal" visibility) (= "public" visibility))

                     (select-multi-language-badge-content {:id (:badge_id my-badge)} (u/get-db ctx)))
        evidences (badge-evidences ctx badge-id)]
    (assoc my-badge :content content
      :evidences evidences)))


(defn get-badge
