Merge branch '18635-remove-unnecesary-.psql-management'
[arvados.git] / services / api / lib / tasks / manage_long_lived_tokens.rake
index d83c2b6030e1e7cc12f6ad4902bda1d13624e756..7a665ff7e77d81eee221534a547591d5750ac1b6 100644 (file)
@@ -29,7 +29,7 @@ namespace :db do
         # skip this token
         next
       end
-      if (auth.user.uuid =~ /-tpzed-000000000000000/).nil?
+      if (auth.user.uuid =~ /-tpzed-000000000000000/).nil? and (auth.user.uuid =~ /-tpzed-anonymouspublic/).nil?
         CurrentApiClientHelper.act_as_system_user do
           auth.update_attributes!(expires_at: exp_date)
         end
@@ -58,7 +58,7 @@ namespace :db do
         # skip this token
         next
       end
-      if not auth.user.nil? and (auth.user.uuid =~ /-tpzed-000000000000000/).nil?
+      if not auth.user.nil? and (auth.user.uuid =~ /-tpzed-000000000000000/).nil? and (auth.user.uuid =~ /-tpzed-anonymouspublic/).nil?
         user_ids.add(auth.user_id)
         token_count += 1
       end