Skip to content

Commit 80b82aa

Browse files
authored
Merge pull request #878 from jbonnet/859-POST-licences-fails
Fixed wrong user uuid reference
2 parents 4d5ef34 + 82c578e commit 80b82aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

son-gtkapi/helpers/common.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def validate_ownership_and_licence(element:, user_name:, kpi_method:, began_at:,
155155
return
156156
end
157157

158-
user_uuid = User.find_by_name(user_name)[:uuid]
158+
user_uuid = User.find_by_name(user_name).uuid
159159
licenced_elements = LicenceManagerService.find({service_uuid: element[:uuid], user_uuid: user_uuid})
160160
if licenced_elements[:items].empty?
161161
# there's no licence for this element for this username
@@ -201,7 +201,7 @@ def enhance_collection(collection:, user:, keys_to_delete:)
201201
next
202202
end
203203

204-
user_uuid = User.find_by_name(user)[:uuid]
204+
user_uuid = User.find_by_name(user).uuid
205205
licenced_collection = LicenceManagerService.find({service_uuid: element[:uuid], user_uuid: user_uuid})
206206
logger.debug(log_message) {"licenced_collection=#{licenced_collection}"}
207207

0 commit comments

Comments
 (0)