Skip to content

Commit

Permalink
cyverse-de#71 Fix for renaming App Communities.
Browse files Browse the repository at this point in the history
  • Loading branch information
psarando committed Oct 18, 2018
1 parent 6cb4f64 commit 3d781a4
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/terrain/clients/iplant_groups.clj
Original file line number Diff line number Diff line change
Expand Up @@ -299,23 +299,28 @@
(get-team user name)
nil)

(defn- update-team* [team-type user name updates]
(defn update-team [user name updates]
(let [client (get-client)
folder (get-team-folder-name client team-type)
folder (get-team-folder-name client group-type-teams)
creator (first (string/split name #":" 2))
group (full-group-name name folder)]
(verify-group-exists client user group)
(->> (update (select-keys updates [:name :description]) :name
full-group-name (get-team-folder-name client team-type creator))
full-group-name (get-team-folder-name client group-type-teams creator))
(remove-vals nil?)
(c/update-group client user group)
(format-group folder))))

(defn update-team [user name updates]
(update-team* group-type-teams user name updates))

(defn update-community [user name updates]
(update-team* group-type-communities user name updates))
(let [client (get-client)
folder (get-team-folder-name client group-type-communities)
group (full-group-name name folder)]
(verify-group-exists client user group)
(->> (update (select-keys updates [:name :description]) :name
full-group-name (get-team-folder-name client group-type-communities))
(remove-vals nil?)
(c/update-group client user group)
(format-group folder))))

(defn- delete-team* [team-type user name]
(let [client (get-client)
Expand Down

0 comments on commit 3d781a4

Please sign in to comment.