Changeset c8a3a93 in indico for indico/MaKaC/rb_reservation.py


Ignore:
Timestamp:
03/22/12 18:05:24 (14 months ago)
Author:
Jose Benito <jose.benito.gonzalez@…>
Branches:
master, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
Children:
2626c2
Parents:
b49d75
Message:

[FIX] Needs assistance modification - Notif

File:
1 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/rb_reservation.py

    rb5c359 rc8a3a93  
    489489        return emails 
    490490 
    491     def notifyAboutUpdate( self ): 
     491    def notifyAboutUpdate( self, attrsBefore ): 
    492492        """ 
    493493        FINAL (not intented to be overriden) 
     
    558558        # ---- Email Assistance ---- 
    559559 
    560         if getRoomBookingOption('assistanceNotificationEmails') and self.room.resvNotificationAssistance: 
     560        if getRoomBookingOption('assistanceNotificationEmails') and self.room.resvNotificationAssistance and (attrsBefore.get('needsAssistance', False) or self.needsAssistance): 
    561561            to = getRoomBookingOption('assistanceNotificationEmails') 
    562562            if to: 
     
    566566                else: 
    567567                    user = None 
    568                 subject = "[Support Request Modification][" + self.room.getFullName() + "] Modified request for " + formatDateTime(self.startDT) 
     568                hasCancelled = attrsBefore.get('needsAssistance', False) and not self.needsAssistance 
     569                textHeader = "Cancelled" if hasCancelled else "Modification" 
     570                subject = "[Support Request "+textHeader+"][" + self.room.getFullName() + "] Modified request for " + formatDateTime(self.startDT) 
    569571                wc = WTemplated( 'RoomBookingEmail_AssistanceAfterBookingModification' ) 
    570                 text = wc.getHTML( { 'reservation': self, 'currentUser': user } ) 
     572                text = wc.getHTML( { 'reservation': self, 'currentUser': user, 'hasCancelled': hasCancelled } ) 
    571573                fromAddr = Config.getInstance().getNoReplyEmail() 
    572574                addrs = [] 
Note: See TracChangeset for help on using the changeset viewer.