django-postmark icon indicating copy to clipboard operation
django-postmark copied to clipboard

rsplit on different timezone format

Open tijs opened this issue 13 years ago • 4 comments

in models.py line 105 it's trying to do an rsplit on the "+" character but in my particular python + django install the timestamp has a different format.

This is the line:

timestamp, tz = resp["SubmittedAt"].rsplit("+", 1) 

And this is the timestamp:

u'SubmittedAt': u'2011-09-23T07:39:47.9044908-04:00',

i.e. there is no + sign in that timestamp

tijs avatar Sep 23 '11 11:09 tijs

i've commited a naive fix of this that at least solves my problem. not the prettiest solution i would imagine... https://github.com/Automatique/django-postmark/commit/ddc2658d80740031b31a3ffc9f044705af0d7b71

tijs avatar Sep 23 '11 13:09 tijs

This is an issue also if server time is in UTC; I absolutely definitely want to keep my servers running in UTC.

laurikari avatar Nov 02 '11 20:11 laurikari

I recently came across this issue as well. tijs's patch worked well for me.

jcarbaugh avatar Nov 21 '11 16:11 jcarbaugh

@jcarbaugh good to hear, please keep in mind that it's not a very solid fix though. All that string mangling should probably be replaced with solid timezone aware code at some point.

tijs avatar Nov 22 '11 11:11 tijs