File tree Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1
1
# Change Log
2
2
All notable changes to this project will be documented in this file.
3
3
4
+ ## [ 3.1.9] - 2016-07-26 ##
5
+ ### Fixed
6
+ - [ Issue #197 ] ( https://github.com/sendgrid/sendgrid-python/issues/197 ) : api_key / apikey attribute logic incorrect
7
+ - Thanks to [ johguse] ( https://github.com/johguse ) for reporting the bug
8
+
4
9
## [ 3.1.8] - 2016-07-25 ##
5
10
### Added
6
11
- [ Troubleshooting] ( https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md ) section
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ def __init__(self, **opts):
15
15
self .path = opts .get ('path' , os .path .abspath (os .path .dirname (__file__ )))
16
16
self ._apikey = opts .get ('apikey' , os .environ .get ('SENDGRID_API_KEY' ))
17
17
# Support v2 api_key naming
18
- self ._apikey = opts .get ('api_key' , os . environ . get ( 'SENDGRID_API_KEY' ) )
18
+ self ._apikey = opts .get ('api_key' , self . _apikey )
19
19
self ._api_key = self ._apikey
20
20
self .useragent = 'sendgrid/{0};python' .format (__version__ )
21
21
self .host = opts .get ('host' , 'https://api.sendgrid.com' )
Original file line number Diff line number Diff line change 1
- version_info = (3 , 1 , 8 )
1
+ version_info = (3 , 1 , 9 )
2
2
__version__ = '.' .join (str (v ) for v in version_info )
Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ def test_apikey_init(self):
40
40
self .assertEqual (self .sg .apikey , os .environ .get ('SENDGRID_API_KEY' ))
41
41
# Support the previous naming convention for API keys
42
42
self .assertEqual (self .sg .api_key , self .sg .apikey )
43
+ my_sendgrid = sendgrid .SendGridAPIClient (apikey = "THISISMYKEY" )
44
+ tmp = os .environ .get ('SENDGRID_API_KEY' )
45
+ os .environ ['SENDGRID_API_KEY' ] = ""
46
+ self .assertEqual (my_sendgrid .apikey , "THISISMYKEY" )
47
+ os .environ ['SENDGRID_API_KEY' ] = tmp
43
48
44
49
def test_useragent (self ):
45
50
useragent = '{0}{1}{2}' .format ('sendgrid/' , __version__ , ';python' )
You can’t perform that action at this time.
0 commit comments