Skip to content

Commit

Permalink
Fixbug reply
Browse files Browse the repository at this point in the history
  • Loading branch information
tanrax committed May 17, 2020
1 parent b374573 commit 97b12c1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject glosa "1.2.0"
(defproject glosa "1.2.1"
:description "glosa"
:url "https://github.com/tanrax/glosa"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
Expand Down
3 changes: 2 additions & 1 deletion src/glosa/adapters/captcha/time.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(ns glosa.adapters.captcha.time
(:require
[glosa.config :refer [config]]
[glosa.models.utils :as utils]
[clojure.string :as string]
[cheshire.core :refer [generate-stream parse-stream]]
Expand All @@ -19,7 +20,7 @@

(def db (atom (db-load)))
(def token-len 20)
(def min-time-seconds 10)
(def min-time-seconds (if (config :debug) 0 10))

;; Functions

Expand Down
7 changes: 4 additions & 3 deletions src/glosa/adapters/database/plain.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
[glosa.ports.captcha :as captcha]
[glosa.models.utils :as utils]
[cheshire.core :refer [generate-stream parse-stream]]
[clojure.java.io :as io]))
[clojure.java.io :as io]
[clojure.string :refer [blank?]]))

(def db (atom {}))
(def db-path "db.json")
Expand Down Expand Up @@ -47,8 +48,8 @@
"Get email parent"
[id]
(let [comment (first (filter (fn [my-comment] (= (:id my-comment) id)) @db))
parent-id (if (or (empty? (:parent comment)) (nil? (:parent comment))) nil (:parent comment))
parent (if-not (nil? parent-id) (first (filter (fn [my-comment] (= (str parent-id) (str (:id my-comment)))) @db)) nil)]
parent-id (:parent comment)
parent (first (filter (fn [my-comment] (= (str parent-id) (str (:id my-comment)))) @db))]
(if parent (:email parent) nil)))

(defn add-comment
Expand Down

0 comments on commit 97b12c1

Please sign in to comment.