File tree 1 file changed +5
-12
lines changed
1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -917,18 +917,11 @@ def _accept_read_only(should_be_read_only: bool):
917
917
"""
918
918
async def can_be_used (connection ):
919
919
settings = connection .get_settings ()
920
- is_read_only = getattr (settings , 'default_transaction_read_only' , None )
921
- if is_read_only is not None :
922
- is_read_only = is_read_only == "on"
923
- else :
924
- is_read_only = False
925
- if should_be_read_only :
926
- if is_read_only :
927
- return True
928
- elif await _accept_in_hot_standby (True )(connection ):
929
- return True
930
- return False
931
- return _accept_in_hot_standby (False )(connection )
920
+ is_read_only = getattr (settings , 'default_transaction_read_only' , 'off' )
921
+
922
+ if should_be_read_only and is_read_only == "on" :
923
+ return True
924
+ return await _accept_in_hot_standby (should_be_read_only )(connection )
932
925
return can_be_used
933
926
934
927
You can’t perform that action at this time.
0 commit comments