File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change 68
68
(log/spyf :info " existing-heratteet!: before rk filtering: %s" )
69
69
(filterv #(= rahoituskausi (palaute/rahoituskausi (:heratepvm %))))
70
70
(log/spyf :info " existing-heratteet!: after rk filtering: %s" )
71
- (utils/assert-pred #(contains? #{0 1 } (count %)))
71
+ ((fn [existing-palautteet]
72
+ (when (> (count existing-palautteet) 1 )
73
+ (log/errorf (str " Found more than one existing herate for "
74
+ " `%s` of HOKS `%d` in rahoituskausi `%s`." )
75
+ kysely-type
76
+ (:id hoks)
77
+ rahoituskausi))
78
+ existing-palautteet))
72
79
first)))
73
80
74
81
(defn build!
Original file line number Diff line number Diff line change 1
1
(ns oph.ehoks.utils
2
- (:require [clojure.string :as string]
3
- [medley.core :refer [dissoc-in map-keys]])
4
- (:import (java.text Normalizer Normalizer$Form)))
2
+ (:require [medley.core :refer [dissoc-in map-keys]]))
5
3
6
4
(defn apply-when
7
5
" Apply function `f` to value `v` if predicate `(pred v)` returns `true`.
8
6
Otherwise returns value `v` unchanged. Useful when used in a threading macro."
9
7
[v pred f]
10
8
(if (pred v) (f v) v))
11
9
12
- (defn assert-pred
13
- " Takes a predicate `pred` and a value `v` that is given to the predicate.
14
- Asserts that `(pred v)` returns `true` and then returns `v`. Useful when used
15
- in a threading macro."
16
- [pred v]
17
- (assert (pred v))
18
- v )
19
-
20
10
(defn to-underscore-str
21
11
[kw]
22
12
(.replace (name kw) \- \_))
You can’t perform that action at this time.
0 commit comments