JBAS-886 skip ecards/classrooms expire extension
authorBill Erickson <berickxx@gmail.com>
Wed, 30 Sep 2015 14:22:38 +0000 (07:22 -0700)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Avoid extending the expire date for Student Ecards and Classroom
Databases accounts.  Minor reformatting for readability.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/utility-scripts/patron_activity/patron_activity.sql

index f301c46..f906937 100644 (file)
@@ -2,14 +2,15 @@ BEGIN;
 SET SESSION STATEMENT_TIMEOUT TO 0;
 
 UPDATE actor.usr usr
-SET expire_date = now() + grp.perm_interval::interval
-FROM permission.grp_tree grp where grp.id = usr.profile and
-usr.id IN (
-SELECT DISTINCT(usr) FROM actor.usr_activity
-WHERE event_time BETWEEN current_date - 2 AND current_date - 1
-AND actor.usr_activity.usr IS NOT NULL
-) AND NOT barred
-AND NOT deleted
-AND profile NOT IN (31, 91, 17, 26, 23, 32, 90, 92, 93);
+    SET expire_date = now() + grp.perm_interval::interval
+    FROM permission.grp_tree grp where grp.id = usr.profile and
+    usr.id IN (
+        SELECT DISTINCT(usr) FROM actor.usr_activity
+        WHERE event_time BETWEEN current_date - 2 AND current_date - 1
+        AND actor.usr_activity.usr IS NOT NULL
+    ) 
+    AND NOT barred
+    AND NOT deleted
+    AND profile NOT IN (31, 91, 17, 26, 23, 32, 90, 92, 93, 901, 902);
 
 COMMIT;