             [oc.storage.resources.entry :as entry-res]))
 
 ;; ----- Utility functions -----
+
+(def org-name-min-length 50)
+(def org-name-max-length 50)
 
 (defn- board-with-access-level
   "

  (try
    ;; Create the new org from the data provided
    (let [org-map (:data ctx)
          author (:user ctx)]
      {:new-org (api-common/rep (org-res/->org org-map author))})

    (catch clojure.lang.ExceptionInfo e
      [false, {:reason (.getMessage e)}]))) ; Not a valid new org

  (if-let [org (org-res/get-org conn slug)]
    (let [samples? (:samples org-props)
          updated-props (if samples? (dissoc org-props :samples :boards) org-props)
          updated-org (merge org (org-res/ignore-props updated-props))
          updating-org-name? (contains? org-props :name)
          org-name (:name org-props)]
      (if (and (lib-schema/valid? common-res/Org updated-org)
               (or (not updating-org-name?)
                   (and updating-org-name?
                        (<= (count org-name) org-name-max-length)
                        (>= (count org-name) org-name-min-length))))
        {:existing-org (api-common/rep org) :updated-org (api-common/rep updated-org)
         :samples (api-common/rep samples?) :boards (api-common/rep (:boards org-props))}
        [false, {:updated-org (api-common/rep updated-org)}])) ; invalid update
