Ejemplo n.º 1
0
 def save(self, *args, **kwargs):  # pylint: disable=arguments-differ
     """Ensure model has token data before saving"""
     try:
         token = self.provider_data.get('token')
     except (AttributeError, TypeError):
         token = None
     finally:
         if token is None:
             token = default_token()
             self.provider_data = {'token': token}
     super(GenericAPIWebhook, self).save(*args, **kwargs)
Ejemplo n.º 2
0
 def save(self, *args, **kwargs):  # pylint: disable=arguments-differ
     """Ensure model has token data before saving."""
     try:
         token = self.provider_data.get('token')
     except (AttributeError, TypeError):
         token = None
     finally:
         if token is None:
             token = default_token()
             self.provider_data = {'token': token}
     super().save(*args, **kwargs)