Skip to content

Commit 9c2882a

Browse files
authored
Merge pull request #17 from linkwithkk/dev
Allow overriding of Trusted_Connection parameter in the connection string
2 parents b41e8b4 + c446bbb commit 9c2882a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ in DATABASES control the behavior of the backend:
7474
Boolean. Set this to `False` if you want to disable
7575
Django's transaction management and implement your own.
7676

77+
- Trusted_Connection
78+
79+
String. Default is `"yes"`. Can be set to `"no"` if required.
80+
7781
and the following entries are also available in the `TEST` dictionary
7882
for any given database-level settings dictionary:
7983

mssql/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ def get_new_connection(self, conn_params):
249249
user = conn_params.get('USER', None)
250250
password = conn_params.get('PASSWORD', None)
251251
port = conn_params.get('PORT', None)
252+
trusted_connection = conn_params.get('Trusted_Connection', 'yes')
252253

253254
options = conn_params.get('OPTIONS', {})
254255
driver = options.get('driver', 'ODBC Driver 13 for SQL Server')
@@ -290,7 +291,7 @@ def get_new_connection(self, conn_params):
290291
cstr_parts['PWD'] = password
291292
else:
292293
if ms_drivers.match(driver):
293-
cstr_parts['Trusted_Connection'] = 'yes'
294+
cstr_parts['Trusted_Connection'] = trusted_connection
294295
else:
295296
cstr_parts['Integrated Security'] = 'SSPI'
296297

0 commit comments

Comments
 (0)