Ignore:
Timestamp:
07/05/09 17:19:38 (11 years ago)
Author:
cbyrom
Message:

Lots of tidy ups to MILK codebase:

Implement new input search filters - with javascript datapickers to
pick the date ranges + add the vocab search ahead text input and
combine this with the text input.

Refactor discovery controller to tidy it up significantly - making more
structured and improving error handling and logging. Improve
templates for the search filter, splitting into multiple files to
organise better.

Various tidying up and tweaks of other codebase - e.g. standardising
use of global variables across app.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/controllers/trackback/trackback.py

    r5076 r5261  
    6464            err = "Could not find document, '%s', to reference in trackback" %uri 
    6565         
    66         server = self.cf.get('DEFAULT', 'mailserver') 
    67         if server is None: 
     66        if not g.mailServer: 
    6867            err = 'Server not configured for trackback (no mail server)' 
    6968         
    70         recipient=self.cf.get('DEFAULT', 'tbrecipient') 
    71         if recipient is None: 
     69        if not g.tbRecipient: 
    7270            err = 'Server not configured for trackback (no recipient)' 
    7371         
     
    7977            c.err = 1 
    8078        else:  
    81             logging.info("Sending notification mail to '%s'" %recipient) 
    82             status, message = mailHandler([recipient,], body, body, 
     79            logging.info("Sending notification mail to '%s'" %g.tbRecipient) 
     80            status, message = mailHandler([g.tbRecipient,], body, body, 
    8381                                          xmlAttachments = [(payload, name),], 
    84                                           server = server) 
     82                                          server = g.mailServer) 
    8583            if status: 
    8684                c.err = 0 
     
    159157            %(self.inputs['Identifier'],self.inputs['Submitter'],self.inputs['Comment']) 
    160158        name = 'ChangeRequestFor_%s.xml' %uri 
    161         maintainer = self.cf.get('DEFAULT','metadataMaintainer') 
    162159         
    163         logging.info("Mailing corrections info to %s" %maintainer) 
    164         status,message = mailHandler([maintainer,], 
     160        logging.info("Mailing corrections info to %s" %g.metadataMaintainer) 
     161        status,message = mailHandler([g.metadataMaintainer], 
    165162                                     body,body,xmlAttachments=[(payload,name),], 
    166                                      server=self.cf.get('DEFAULT','mailserver')) 
     163                                     server = g.mailServer) 
    167164        if status: 
    168165            result = 'Your comments have been sent to the metadata maintainer and added to corrections feed for the metatadata database.' 
     
    173170        logging.info("- now add these to the corrections feed") 
    174171        # add the maintainer info 
    175         body += " - for metadata maintainer, '%s'" %maintainer  
     172        body += " - for metadata maintainer, '%s'" %g.metadataMaintainer  
    176173        g.validator._atomClient.feedClient.createGenericFeedEntry(body, payload, 
    177174                                                                  dc.CORRECTIONS_COLLECTION_PATH) 
Note: See TracChangeset for help on using the changeset viewer.