Skip to content

Commit

Permalink
fix: use {} instead of nil
Browse files Browse the repository at this point in the history
Otherwise get an exception while creating a new database. Test must be
matched to this.
  • Loading branch information
Macroz committed Nov 21, 2024
1 parent a34e4b5 commit e702c4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/clj/rems/db/applications.clj
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
(group-users-by-role apps)))))

(defn- user-roles-frequencies [applications]
(when (seq applications)
(if (seq applications)
(let [all-user-roles (->> applications
(eduction (map val)
(mapcat :application/user-roles)))
Expand All @@ -219,7 +219,8 @@
roles-by-user
users)
(dissoc! ::users)
persistent!))))
persistent!))
{}))

(defn- update-user-roles [updated-users old-roles-by-user old-updated-enriched-apps new-updated-enriched-apps]
(let [all-old-app-roles (user-roles-frequencies old-updated-enriched-apps)
Expand Down
2 changes: 1 addition & 1 deletion test/clj/rems/application/test_model.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@
:event/actor-attributes {:userid "handler" :email "[email protected]" :name "Handler" :secret "secret"}
:event/visibility :visibility/public}]
:application/user-roles {"handler" #{:handler}, "reporter1" #{:reporter}}
:application/role-permissions nil
:application/role-permissions {}
:application/description "foo"
:application/forms [{:form/id 40
:form/title "form name" ; deprecated
Expand Down

0 comments on commit e702c4b

Please sign in to comment.