Ticket #2304: fixed_transaction_settings_variable_name.diff
File fixed_transaction_settings_variable_name.diff, 2.1 KB (added by , 14 years ago) |
---|
-
db/transaction.py
61 61 state[thread_ident][using].append(state[thread_ident][using][-1]) 62 62 else: 63 63 state.setdefault(thread_ident, {}) 64 state[thread_ident][using] = [settings.TRANSACTIONS_MANAGED] 64 if hasattr(settings, 'TRANSACTIONS_MANAGED'): 65 state[thread_ident][using] = [settings.TRANSACTIONS_MANAGED] 66 warnings.warn( 67 '`settings.TRANSACTIONS_MANAGED` is deprecated. ' 68 'Please update your code to use DISABLE_TRANSACTION_MANAGEMENT.', 69 PendingDeprecationWarning 70 ) 71 else: 72 state[thread_ident][using] = [settings.DISABLE_TRANSACTION_MANAGEMENT] 73 65 74 if thread_ident not in dirty or using not in dirty[thread_ident]: 66 75 dirty.setdefault(thread_ident, {}) 67 76 dirty[thread_ident][using] = False … … 142 151 if thread_ident in state and using in state[thread_ident]: 143 152 if state[thread_ident][using]: 144 153 return state[thread_ident][using][-1] 145 return settings.TRANSACTIONS_MANAGED 154 if hasattr(settings, 'TRANSACTIONS_MANAGED'): 155 warnings.warn( 156 '`settings.TRANSACTIONS_MANAGED` is deprecated. ' 157 'Please update your code to use DISABLE_TRANSACTION_MANAGEMENT.', 158 PendingDeprecationWarning 159 ) 160 return settings.TRANSACTIONS_MANAGED 161 else: 162 return settings.DISABLE_TRANSACTION_MANAGEMENT 146 163 147 164 def managed(flag=True, using=None): 148 165 """ -
conf/global_settings.py
378 378 379 379 # Do you want to manage transactions manually? 380 380 # Hint: you really don't! 381 TRANSACTIONS_MANAGED= False381 DISABLE_TRANSACTION_MANAGEMENT = False 382 382 383 383 # The User-Agent string to use when checking for URL validity through the 384 384 # isExistingURL validator.