Beispiel #1
0
    def save(self, author, *args, **kwargs):
        self.author = author

        #-----------------------------------#
        # This is email stuff. Would be good
        # if it could be hived off to a signal
        #-  --------------------------------#
        # ||
        # \/
        #record newness before saving
        if self.id:
            type='status_change'
            old = Decision.objects.get(id=self.id)
            if old.status != self.status:
                type='status_change'
            else:
                type='content_change'
        else:
            old = None
            type='new'
                    
        super(Decision, self).save(*args, **kwargs)

        email = OpenConsentEmailMessage(type=type,
                                        object = self,
                                        old_object = old)  

        email.send()
Beispiel #2
0
    def save(self, *args, **kwargs):
        self.excerpt = self._get_excerpt()        

        if not self.id:
            self.created_date = datetime.date.today()        

        #-----------------------------------#
        # This is email stuff. Would be good
        # if it could be hived off to a signal
        #-  --------------------------------#
        # ||
        # \/
        #record newness before saving
        if self.id:
            typ = 'status_change'
            old = Decision.objects.get(id=self.id)
            if old.status != self.status:
                typ = 'status_change'
            else:
                typ = 'content_change'
        else:
            old = None
            typ = 'new'
                    
        super(Decision, self).save(*args, **kwargs)

        email = OpenConsentEmailMessage(typ = typ,
                                        obj = self,
                                        old_obj = old)  

        email.send()
Beispiel #3
0
    def save(self, author, *args, **kwargs):
        self.excerpt = self._get_excerpt()
        self.author = author

        if not self.id:
            self.created_date = datetime.date.today()

        #-----------------------------------#
        # This is email stuff. Would be good
        # if it could be hived off to a signal
        #-  --------------------------------#
        # ||
        # \/
        #record newness before saving
        if self.id:
            typ = 'status_change'
            old = Decision.objects.get(id=self.id)
            if old.status != self.status:
                typ = 'status_change'
            else:
                typ = 'content_change'
        else:
            old = None
            typ = 'new'

        super(Decision, self).save(*args, **kwargs)

        email = OpenConsentEmailMessage(typ=typ, obj=self, old_obj=old)

        email.send()