def save(self, *args, **kwargs): # Strip whitespace from langs before save # Also confirm_message or welcome self.languages = self.languages.replace(" ", "") self.welcome = self.welcome.strip() self.confirm_message = self.confirm_message.strip() super(Newsletter, self).save(*args, **kwargs) # Cannot import earlier due to circular import from news.newsletters import clear_newsletter_cache # Newsletter data might have changed, forget our cached version of it clear_newsletter_cache()
def handle(self, *args, **options): sync_data(url='https://{}/news/sync/'.format(options['domain']), clean=options['clean'], api_token=options['key']) clear_newsletter_cache() clear_sms_cache()
def post_newsletter_delete(sender, **kwargs): # Cannot import earlier due to circular import from news.newsletters import clear_newsletter_cache clear_newsletter_cache()