File tree Expand file tree Collapse file tree 3 files changed +13
-10
lines changed Expand file tree Collapse file tree 3 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,8 @@ def event_processor(event, hint):
216
216
217
217
if _should_send_default_pii ():
218
218
user_info = event .setdefault ("user" , {})
219
- user_info ["ip_address" ] = get_client_ip (environ )
219
+ if "ip_address" not in user_info :
220
+ user_info ["ip_address" ] = get_client_ip (environ )
220
221
221
222
if "query_string" not in request_info :
222
223
request_info ["query_string" ] = environ .get ("QUERY_STRING" )
Original file line number Diff line number Diff line change @@ -140,15 +140,17 @@ def _set_user_info(request, event):
140
140
if user is None or not is_authenticated (user ):
141
141
return
142
142
143
- try :
144
- user_info ["email" ] = user .email
145
- except Exception :
146
- pass
143
+ if "email" not in user_info :
144
+ try :
145
+ user_info ["email" ] = user .email
146
+ except Exception :
147
+ pass
147
148
148
- try :
149
- user_info ["username" ] = user .get_username ()
150
- except Exception :
151
- pass
149
+ if "username" not in user_info :
150
+ try :
151
+ user_info ["username" ] = user .get_username ()
152
+ except Exception :
153
+ pass
152
154
153
155
154
156
class _FormatConverter (object ):
Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ def _add_user_to_event(event):
135
135
136
136
user_info = event .setdefault ("user" , {})
137
137
138
- if user_info . get ( "id" , None ) is None :
138
+ if "id" not in user_info :
139
139
try :
140
140
user_info ["id" ] = user .get_id ()
141
141
# TODO: more configurable user attrs here
You can’t perform that action at this time.
0 commit comments