-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from chadgates/timezone_in_datetime
Prevent RuntimeWarning: DateTimeField received a naive datetime in django-pyas2
- Loading branch information
Showing
3 changed files
with
16 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -305,7 +305,8 @@ def headers_str(self): | |
return message_header.encode('utf-8') | ||
|
||
def build(self, data, filename=None, subject='AS2 Message', | ||
content_type='application/edi-consent', additional_headers=None): | ||
content_type='application/edi-consent', additional_headers=None, | ||
disposition_notification_to='[email protected]'): | ||
|
||
"""Function builds the AS2 message. Compresses, signs and encrypts | ||
the payload if applicable. | ||
|
@@ -326,6 +327,10 @@ def build(self, data, filename=None, subject='AS2 Message', | |
:param additional_headers: | ||
Any additional headers to be included as part of the AS2 message. | ||
:param disposition_notification_to: | ||
Email address for disposition-notification-to header entry. | ||
(default "[email protected]") | ||
""" | ||
|
||
# Validations | ||
|
@@ -441,7 +446,7 @@ def build(self, data, filename=None, subject='AS2 Message', | |
self.message_id, self.payload.as_string())) | ||
|
||
if self.receiver.mdn_mode: | ||
as2_headers['disposition-notification-to'] = '[email protected]' | ||
as2_headers['disposition-notification-to'] = disposition_notification_to | ||
if self.receiver.mdn_digest_alg: | ||
as2_headers['disposition-notification-options'] = \ | ||
'signed-receipt-protocol=required, pkcs7-signature; ' \ | ||
|
@@ -550,7 +555,6 @@ def parse(self, raw_content, find_org_cb, find_partner_cb, | |
self.enc_alg, decrypted_content = decrypt_message( | ||
encrypted_data, self.receiver.decrypt_key) | ||
|
||
raw_content = decrypted_content | ||
self.payload = parse_mime(decrypted_content) | ||
|
||
if self.payload.get_content_type() == 'text/plain': | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters