Changeset 6bbcc8 in indico


Ignore:
Timestamp:
05/26/11 14:17:50 (2 years ago)
Author:
Jose Benito <jose.benito.gonzalez@…>
Branches:
master, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 0da0c1403bae8e51d8229f460181c71b9e6dda72
Children:
6ed8c1
Parents:
c17e12
git-author:
Alberto Resco Perez <alberto.resco.perez@…> (04/27/11 15:21:35)
git-committer:
Jose Benito <jose.benito.gonzalez@…> (05/26/11 14:17:50)
Message:

[FIX] Registration connect to avatar if not login

  • If the user is not logged in and register with the same email, the user will be connected to his avatar.
  • Closes task #742
File:
1 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/webinterface/rh/registrationFormDisplay.py

    r2cf43b4 r6bbcc8  
    141141 
    142142    def _process( self ): 
    143         user = self._getUser() 
    144         canManageRegistration = self._conf.canManageRegistration(user) 
    145         if not canManageRegistration and (not self._regForm.isActivated() or not self._conf.hasEnabledSection("regForm")): 
     143        canManageRegistration = self._conf.canManageRegistration(self._getUser()) 
     144        if not canManageRegistration and not self._regForm.isActivated(): 
    146145            p = registrationForm.WPRegFormInactive( self, self._conf ) 
    147146            return p.display() 
    148147        params = self._getRequestParams() 
    149         if canManageRegistration: 
    150             matchedUsers = AvatarHolder().match({"email": params["email"]}) 
    151             if matchedUsers: 
    152                 user = matchedUsers[0] 
    153             else: 
    154                 user = None 
    155         else: 
     148 
     149        matchedUsers = AvatarHolder().match({"email": params["email"]}) 
     150        if matchedUsers: 
     151            user = matchedUsers[0] 
     152        else: 
     153            user = None 
     154        # Check if the user can register 
     155        if not canManageRegistration: # normal user registering. Managers can. 
    156156            if self._conf.getRegistrationForm().isFull(): 
    157157                self._redirect(urlHandlers.UHConfRegistrationFormDisplay.getURL(self._conf)) 
     
    167167                self._redirect(urlHandlers.UHConfRegistrationForm.getURL(self._conf)) 
    168168                return 
    169             if self._conf.hasRegistrantByEmail(self._getUser().getEmail()): 
     169            if self._conf.hasRegistrantByEmail(user.getEmail()): 
    170170                raise FormValuesError("You have already registered with the email address \"%s\". If you need to modify your registration, please contact the managers of the conference."%self._getUser().getEmail()) 
    171171        rp = registration.Registrant() 
Note: See TracChangeset for help on using the changeset viewer.