comparison MPIWGStaff.py @ 222:95e0087b9e19

removed some comparisons that ignore person-id case.
author casties
date Mon, 28 Oct 2013 18:42:24 +0100
parents 2598210ada7a
children 4f2ed4dc50e6
comparison
equal deleted inserted replaced
218:0babf6e0a454 222:95e0087b9e19
91 content = self.executeZSQL("select * from personal_www where e_mail = %s", [email]) 91 content = self.executeZSQL("select * from personal_www where e_mail = %s", [email])
92 if len(content) > 0: 92 if len(content) > 0:
93 member = MPIWGStaffMember(self, dbresult=content[0]) 93 member = MPIWGStaffMember(self, dbresult=content[0])
94 94
95 elif key is not None: 95 elif key is not None:
96 # TODO: sometimes key is lowercased (e.g. responsibleScientistsList), we should fix the data 96 content = self.executeZSQL("select * from personal_www where key = %s", [key])
97 content = self.executeZSQL("select * from personal_www where lower(key) = %s", [key.lower()])
98 if len(content) > 0: 97 if len(content) > 0:
99 member = MPIWGStaffMember(self, dbresult=content[0]) 98 member = MPIWGStaffMember(self, dbresult=content[0])
100 99
101 return member 100 return member
102 101
103 102
104 def isActiveMember(self, key): 103 def isActiveMember(self, key):
105 """returns if member key is active""" 104 """returns if member key is active"""
106 res = self.executeZSQL("select * from personal_www where lower(key) = %s and publish_the_data = 'yes'", [key.lower()]) 105 res = self.executeZSQL("select * from personal_www where key = %s and publish_the_data = 'yes'", [key])
107 return len(res) > 0 106 return len(res) > 0
108 107
109 108
110 def getMemberList(self, department=None, sortBy='last_name', onlyCurrent=False, arrivedWithin=None, 109 def getMemberList(self, department=None, sortBy='last_name', onlyCurrent=False, arrivedWithin=None,
111 onlyPublished=True, onlyWithEmail=True, onlyScholar=True, limit=0): 110 onlyPublished=True, onlyWithEmail=True, onlyScholar=True, limit=0):