mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
Improve and document JSON serialization for Mandrill API
* Add some context to exceptions on unserializable values (addresses #89). * Document need to format merge data (into something JSON-serializable). * Add RemovedInDjrill2 DeprecationWarning. * Deprecate blanket date/datetime serialization.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from requests import HTTPError
|
||||
import warnings
|
||||
|
||||
|
||||
class MandrillAPIError(HTTPError):
|
||||
@@ -32,3 +33,11 @@ class NotSupportedByMandrillError(ValueError):
|
||||
avoid duplicating Mandrill's validation logic locally.)
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class RemovedInDjrill2(DeprecationWarning):
|
||||
"""Functionality due for deprecation in Djrill 2.0"""
|
||||
|
||||
|
||||
def removed_in_djrill_2(message, stacklevel=1):
|
||||
warnings.warn(message, category=RemovedInDjrill2, stacklevel=stacklevel + 1)
|
||||
|
||||
Reference in New Issue
Block a user