Changeset af4162 in indico


Ignore:
Timestamp:
02/23/10 08:47:26 (3 years ago)
Author:
Jose Benito <jose.benito.gonzalez@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, new-webex, prov-dual-interface, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
Children:
019031, f3d0f4
Parents:
9278fc
Message:

[FIX] Missing locationAddress value

set to empty string by default

File:
1 edited

Legend:

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

    r0c8aad raf4162  
    6767class RHCategoryDisplay( RHCategDisplayBase ): 
    6868    _uh = urlHandlers.UHCategoryDisplay 
    69      
     69 
    7070    def _process( self ): 
    71          
     71 
    7272        wfReg = webFactoryRegistry.WebFactoryRegistry() 
    7373        p = category.WPCategoryDisplay( self, self._target, wfReg ) 
     
    7777class RHCategoryMap( RHCategDisplayBase ): 
    7878    _uh = urlHandlers.UHCategoryMap 
    79      
     79 
    8080    def _process( self ): 
    8181        p = category.WPCategoryMap( self, self._target ) 
     
    8484class RHCategoryStatistics( RHCategDisplayBase ): 
    8585    _uh = urlHandlers.UHCategoryStatistics 
    86      
     86 
    8787    def _process( self ): 
    8888        wfReg = webFactoryRegistry.WebFactoryRegistry() 
     
    9292 
    9393class RHCategOverviewDisplay( RHCategDisplayBase ): 
    94      
     94 
    9595    def _checkParams( self, params ): 
    9696        id = params.get("selCateg", "") 
     
    115115            self._cal = wcalendar.Overview( self._aw, sd, [self._target] ) 
    116116        self._cal.setDetailLevel( params.get("detail", "conference") ) 
    117      
     117 
    118118    def _process( self ): 
    119119        p = category.WPCategOverview( self, self._target, self._cal ) 
     
    121121 
    122122class RHConferenceCreationBase( RHCategoryDisplay ): 
    123      
    124     def _checkProtection( self ):  
     123 
     124    def _checkProtection( self ): 
    125125        self._checkSessionUser() 
    126126        RHCategoryDisplay._checkProtection( self ) 
     
    129129        if not self._target.canCreateConference( self._getUser() ): 
    130130            raise MaKaCError( _("You are not allowed to create conferences inside this category")) 
    131      
     131 
    132132    def _checkParams( self, params, mustExist=1 ): 
    133133        RHCategoryDisplay._checkParams( self, params, mustExist ) 
     
    139139        if et != "" and et !="default": 
    140140            self._wf = self._wfReg.getFactoryById( et ) 
    141          
     141 
    142142 
    143143#------------------------------------------------------------------------------------- 
     
    192192        return 
    193193 
    194     def _process( self ):    
     194    def _process( self ): 
    195195        params = self._getRequestParams() 
    196196        if params["title"]=="": 
     
    231231                c = lectures[0] 
    232232            self._redirect(urlHandlers.UHConferenceModification.getURL( c ) ) 
    233         else :      
     233        else : 
    234234            url = urlHandlers.UHCategoryDisplay.getURL(self._target) 
    235235            self._redirect(url) 
     
    248248                c.disableSessionSlots() 
    249249        return c 
    250              
     250 
    251251    def _getPersons(self): 
    252252        avatars, newUsers = [], [] 
     
    309309%s """ % (i,c.getStartDate(), c.getEndDate(), i,urlHandlers.UHConferenceDisplay.getURL(c)) 
    310310                i+=1 
    311          
     311 
    312312        msg = ("Content-Type: text/plain; charset=\"utf-8\"\r\nFrom: %s\r\nReturn-Path: %s\r\nTo: %s\r\nCc: \r\nSubject: %s\r\n\r\n"%(fromAddr, fromAddr, addrs, subject)) 
    313313        msg = msg + text 
    314         maildata = { "fromAddr": fromAddr, "toList": addrs, "subject": subject, "body": text }         
     314        maildata = { "fromAddr": fromAddr, "toList": addrs, "subject": subject, "body": text } 
    315315        self._emailsToBeSent.append(maildata) 
    316316        # Category notification 
     
    319319            maildata2 = { "fromAddr": fromAddr, "toList": addrs2, "subject": subject, "body": text } 
    320320            self._emailsToBeSent.append(maildata2) 
    321          
    322          
     321 
     322 
    323323class UtilPersons: 
    324          
     324 
    325325    @staticmethod 
    326     def addToConf( avatars, newUsers, conf, grantManager):  
    327          
     326    def addToConf( avatars, newUsers, conf, grantManager): 
     327 
    328328        if newUsers : 
    329329            for newUser in newUsers: 
     
    343343                    #self._errorList.append("%s has been already defined as %s of this conference"%(person.getFullName(),self._typeName)) 
    344344                    pass 
    345          
     345 
    346346        if avatars: 
    347347 
    348348            for selected in avatars : 
    349                 if isinstance(selected, user.Avatar) :                     
     349                if isinstance(selected, user.Avatar) : 
    350350                    person = ConferenceChair() 
    351351                    person.setDataFromAvatar(selected) 
     
    353353                        #TODO: add to conf 
    354354                        UtilPersons._add(conf, person, grantManager) 
    355                     else :                         
     355                    else : 
    356356                        #self._errorList.append("%s has been already defined as %s of this conference"%(person.getFullName(),self._typeName)) 
    357357                        pass 
    358                          
    359                 #elif isinstance(selected, user.Group) :  
     358 
     359                #elif isinstance(selected, user.Group) : 
    360360                #    for member in selected.getMemberList() : 
    361361                #        person = ConferenceChair() 
    362362                #        person.setDataFromAvatar(member) 
    363363                #        if not self._alreadyDefined(person, definedList) : 
    364                 #            definedList.append([person,params.has_key("submissionControl")])             
     364                #            definedList.append([person,params.has_key("submissionControl")]) 
    365365                #        else : 
    366366                #            self._errorList.append("%s has been already defined as %s of this conference"%(presenter.getFullName(),self._typeName)) 
    367          
     367 
    368368    @staticmethod 
    369369    def _alreadyDefined(person):#, definedList): 
     
    442442                c.setLocation( l ) 
    443443            l.setName( confData["locationName"] ) 
    444             l.setAddress( confData["locationAddress"] ) 
     444            l.setAddress( confData.get("locationAddress","") ) 
    445445 
    446446        roomName = confData.get( "locationBookedRoom" )  or  confData.get( "roomName" )  or  "" 
     
    472472 
    473473class RHCategoryGetIcon(RHCategDisplayBase): 
    474      
     474 
    475475    def _process(self): 
    476476        icon=self._target.getIcon() 
     
    501501 
    502502class RHCategoryToiCal(RHCategoryOpenService): 
    503      
     503 
    504504    def _processData( self ): 
    505505        filename = "%s - Event.ics"%self._target.getName().replace("/","") 
     
    518518    def _getRSS( self, tz ): 
    519519        return CategoryToRSS(self._target,tz=tz).getBody() 
    520      
     520 
    521521    def _processData( self ): 
    522522        data = "" 
     
    529529 
    530530class RHTodayCategoryToRSS(RHCategoryToRSS): 
    531      
     531 
    532532    def _getRSS( self, tz ): 
    533533        return CategoryToRSS(self._target, date=nowutc().astimezone(timezone(tz)), tz=tz).getBody() 
    534      
     534 
    535535 
    536536def sortByStartDate(conf1,conf2): 
    537     return cmp(conf1.getStartDate(),conf2.getStartDate())  
    538  
     537    return cmp(conf1.getStartDate(),conf2.getStartDate()) 
     538 
Note: See TracChangeset for help on using the changeset viewer.