Mercurial > hg > MPIWGWeb
comparison MPIWGStaff.py @ 48:f59bdd5f4890
Merge with 5c6ad316e1ceef48e323907ab81dd50e7ef743b2
author | dwinter |
---|---|
date | Mon, 29 Apr 2013 16:02:24 +0200 |
parents | 225179dfd892 fd8e78bbc5ed |
children | e718d9a72f19 |
comparison
equal
deleted
inserted
replaced
47:225179dfd892 | 48:f59bdd5f4890 |
---|---|
1091 content = self.executeZSQL("select * from personal_www where e_mail = %s", [email]) | 1091 content = self.executeZSQL("select * from personal_www where e_mail = %s", [email]) |
1092 if len(content) > 0: | 1092 if len(content) > 0: |
1093 member = MPIWGStaffMember(self, dbresult=content) | 1093 member = MPIWGStaffMember(self, dbresult=content) |
1094 | 1094 |
1095 elif key is not None: | 1095 elif key is not None: |
1096 content = folder.executeZSQL("select * from personal_www where key = %s", [key]) | 1096 # TODO: sometimes key is lowercased (e.g. responsibleScientistsList), we should fix the data |
1097 content = self.executeZSQL("select * from personal_www where lower(key) = %s", [key.lower()]) | |
1097 if len(content) > 0: | 1098 if len(content) > 0: |
1098 member = MPIWGStaffMember(self, dbresult=content) | 1099 member = MPIWGStaffMember(self, dbresult=content) |
1099 | 1100 |
1100 return member | 1101 return member |
1101 | 1102 |
1103 | |
1104 def isActiveMember(self, key): | |
1105 """returns if member key is active""" | |
1106 res = self.executeZSQL("select * from personal_www where lower(key) = %s and publish_the_data = 'yes'", [key.lower()]) | |
1107 return len(res) > 0 | |
1108 | |
1102 | 1109 |
1103 def sortPriority(self,list): | 1110 def sortPriority(self,list): |
1104 def sort(x,y): | 1111 def sort(x,y): |
1105 try: | 1112 try: |
1106 xInt=int(x.priority) | 1113 xInt=int(x.priority) |
1576 | 1583 |
1577 self.executeZSQL(query) | 1584 self.executeZSQL(query) |
1578 REQUEST.response.redirect(self.REQUEST['HTTP_REFERER']) | 1585 REQUEST.response.redirect(self.REQUEST['HTTP_REFERER']) |
1579 | 1586 |
1580 | 1587 |
1581 def invalidate_chache(self): | 1588 def invalidate_cache(self): |
1582 #TODO: How to invalidate the varnish cache from the member object | 1589 #TODO: How to invalidate the varnish cache from the member object |
1583 pass; | 1590 pass; |
1584 | 1591 |
1585 | 1592 |
1586 def getStaffURL(self): | 1593 def getStaffURL(self): |