예제 #1
0
    def save(self, *args, **kwargs):
        # If template is a translation, use default template's name
        if self.default_template and not self.name:
            self.name = self.default_template.name

        template = super(EmailTemplate, self).save(*args, **kwargs)
        cache.delete(self.name)
        return template
예제 #2
0
    def save(self, *args, **kwargs):
        # If template is a translation, use default template's name
        if self.default_template and not self.name:
            self.name = self.default_template.name

        template = super(EmailTemplate, self).save(*args, **kwargs)
        cache.delete(self.name)
        return template
예제 #3
0
 def test_basic_cache_operations(self):
     """
         Test basic cache operations
     """
     # clean test cache
     cache.cache_backend.clear()
     self.assertEqual(None, cache.get("test-cache"))
     cache.set("test-cache", "awesome content")
     self.assertTrue("awesome content", cache.get("test-cache"))
     cache.delete("test-cache")
     self.assertEqual(None, cache.get("test-cache"))
예제 #4
0
 def test_basic_cache_operations(self):
     """
         Test basic cache operations
     """
     # clean test cache
     cache.cache_backend.clear()
     self.assertEqual(None, cache.get('test-cache'))
     cache.set('test-cache', 'awesome content')
     self.assertTrue('awesome content', cache.get('test-cache'))
     cache.delete('test-cache')
     self.assertEqual(None, cache.get('test-cache'))
예제 #5
0
 def test_basic_cache_operations(self):
     """
         Test basic cache operations
     """
     # clean test cache
     cache.cache_backend.clear()
     self.assertEqual(None, cache.get('test-cache'))
     cache.set('test-cache', 'awesome content')
     self.assertTrue('awesome content', cache.get('test-cache'))
     cache.delete('test-cache')
     self.assertEqual(None, cache.get('test-cache'))
예제 #6
0
    def save(self, *args, **kwargs):
        # If template is a translation, use default template's name
        if self.default_template and not self.name:
            self.name = self.default_template.name

        site = sites_models.Site.objects.get_current()
        if site.pk:
            self.site = site

        template = super(EmailTemplate, self).save(*args, **kwargs)
        cache.delete(self.name)
        return template
예제 #7
0
 def save(self, *args, **kwargs):
     # If template is a translation, use default template's name
     if self.default_template:
         if not self.name:
             self.name = self.default_template.name
         if not self.template_path:
             self.template_path = self.default_template.template_path
     if not self.template_path:
         self.template_path = self.TEMPLATE_CHOICES[0][0]
     self.update_mail_content()
     obj = super(EmailTemplate, self).save(*args, **kwargs)
     cache.delete(self.name)
     return obj
예제 #8
0
 def save(self, *args, **kwargs):
     template = super(EmailTemplate, self).save(*args, **kwargs)
     cache.delete(self.name)
     return template
예제 #9
0
 def save(self, *args, **kwargs):
     template = super(EmailTemplate, self).save(*args, **kwargs)
     cache.delete(self.name)
     return template
예제 #10
0
 def save(self, *args, **kwargs):
     self.last_updated = now
     template = super(EmailTemplate, self).save(*args, **kwargs)
     cache.delete(self.name)
     return template