Merge branch '2991-job-docker-images' refs #2991
[arvados.git] / services / api / lib / current_api_client.rb
index c5581502cf3b9e5eaa66f74271ed72c8998604ea..94bd2b56a887999fa73b6603944a45136cef4bd9 100644 (file)
@@ -140,18 +140,18 @@ module CurrentApiClient
                                      last_name: 'anonymouspublic')
           $anonymous_user.save!
           $anonymous_user.reload
+        end
 
-          group_perms = Link.where(tail_uuid: anonymous_user_uuid,
-                                   head_uuid: anonymous_group_uuid,
-                                   link_class: 'permission',
-                                   name: 'can_read')
+        group_perms = Link.where(tail_uuid: anonymous_user_uuid,
+                                 head_uuid: anonymous_group_uuid,
+                                 link_class: 'permission',
+                                 name: 'can_read')
 
-          if !group_perms.any?
-            group_perm = Link.create(tail_uuid: anonymous_user_uuid,
-                                   head_uuid: anonymous_group_uuid,
-                                   link_class: 'permission',
-                                   name: 'can_read')
-          end
+        if !group_perms.any?
+          group_perm = Link.create!(tail_uuid: anonymous_user_uuid,
+                                    head_uuid: anonymous_group_uuid,
+                                    link_class: 'permission',
+                                    name: 'can_read')
         end
       end
     end