From ad9b8b252be7bac662b7424df65807a285c42762 Mon Sep 17 00:00:00 2001
From: GraceDB Live <branson@gravity.phys.uwm.edu>
Date: Sun, 19 Jan 2014 12:26:08 -0600
Subject: [PATCH] I (Branson) found this local change to
 refresh_users_from_ldap on archie. It looks harmless, so I'm keeping it.

---
 ligoauth/management/commands/refresh_users_from_ldap.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ligoauth/management/commands/refresh_users_from_ldap.py b/ligoauth/management/commands/refresh_users_from_ldap.py
index 476c46b3d..5a115eee0 100644
--- a/ligoauth/management/commands/refresh_users_from_ldap.py
+++ b/ligoauth/management/commands/refresh_users_from_ldap.py
@@ -57,7 +57,10 @@ class Command(NoArgsCommand):
                             # revoke staff/superuser if not active.
                             user.is_staff = user.is_staff and is_active
                             user.is_superuser = user.is_superuser and is_active
-                            user.save()
+                            try:
+                                user.save()
+                            except Exception, e:
+                                print "Failed to save user '%s'.  (%s)" % (ldap_dn, first_name+" "+last_name)
 
                         # update X509 certs for user
                         current_dns = set([ cert.subject for cert in user.x509cert_set.all() ])
-- 
GitLab