Browse files

[IMP] Grant submission rights better perf

  • Loading branch information...
1 parent 2e1a001 commit 640d35bc0174e81ffb3e06722935eb2a9037527c @jbenito3 jbenito3 committed May 10, 2012
Showing with 4 additions and 9 deletions.
  1. +3 −1 indico/MaKaC/conference.py
  2. +1 −8 indico/MaKaC/user.py
View
4 indico/MaKaC/conference.py
@@ -9464,7 +9464,9 @@ def grantSubmission(self,sb, sendEmail=True):
self._initSubmissionPrivileges()
if isinstance(sb, ContributionParticipation) or isinstance(sb, SubContribParticipation):
ah = AvatarHolder()
- results=ah.match({"email":sb.getEmail()}, exact=1)
+ results=ah.match({"email":sb.getEmail()}, exact=1, forceWithoutExtAuth=True)
+ if not results:
+ results=ah.match({"email":sb.getEmail()}, exact=1)
r=None
for i in results:
if i.hasEmail(sb.getEmail()):
View
9 indico/MaKaC/user.py
@@ -1538,13 +1538,6 @@ def match(self, criteria, exact=0, onlyActivated=True, forceWithoutExtAuth=False
for authId in Config.getInstance().getAuthenticatorList():
if not authId == "Local":
dict = euh.getById(authId).match(criteria, exact=exact)
- if authId == "Nice":
- auth = NiceAuthentication.NiceAuthenticator()
- elif authId == "LDAP":
- auth = LDAPAuthentication.LDAPAuthenticator()
- else:
- raise MaKaCError(
- _("Authentication type " + authId + " is not known."))
for email in dict.iterkeys():
# TODO and TOSTUDY: result.keys should be replace it with
# l=[]; for av in result.values(): l.append(av.getAllEmails())
@@ -1557,7 +1550,7 @@ def match(self, criteria, exact=0, onlyActivated=True, forceWithoutExtAuth=False
# TODO: logins can be reused, hence the removal
# TODO: check if same can happen with emails
# if auth.hasKey(dict[email]["login"]):
- # av = auth.getById(dict[email]["login"]).getUser()
+ # av = auth.getById(dict[email]["login"]).getUser()
result[email] = av
else:
av = self.match({'email': email}, exact=1, forceWithoutExtAuth=True)[0]

0 comments on commit 640d35b

Please sign in to comment.