Skip to content
Snippets Groups Projects
Commit eb264e6d authored by Cam Saül's avatar Cam Saül
Browse files

Merge pull request #443 from metabase/mongo_driver_handle_blank_strings

Mongo driver should ignore naughty blank strings :smiling_imp:
parents 4fc0a5b2 9d9f9246
No related branches found
No related tags found
No related merge requests found
(ns metabase.driver.mongo.util
"`*mongo-connection*`, `with-mongo-connection`, and other functions shared between several Mongo driver namespaces."
(:require [clojure.tools.logging :as log]
(:require [clojure.string :as s]
[clojure.tools.logging :as log]
[colorize.core :as color]
[monger.core :as mg]
[metabase.driver :as driver]))
......@@ -11,12 +12,12 @@
dbname]}
(str "mongodb://"
user
(when pass
(assert user "Can't have a password without a user!")
(when-not (s/blank? pass)
(assert (not (s/blank? user)) "Can't have a password without a user!")
(str ":" pass))
(when user "@")
(when-not (s/blank? user) "@")
host
(when port
(when-not (s/blank? (str port))
(str ":" port))
"/"
dbname))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment