##// END OF EJS Templates
exc-tracker: make context attribute behave like in API case...
marcink -
r4277:0d8d4107 default
parent child Browse files
Show More
@@ -283,7 +283,7 b' def get_current_lang(request):'
283 283 return getattr(request, '_LOCALE_', request.locale_name)
284 284
285 285
286 def attach_context_attributes(context, request, user_id=None):
286 def attach_context_attributes(context, request, user_id=None, is_api=None):
287 287 """
288 288 Attach variables into template context called `c`.
289 289 """
@@ -379,7 +379,8 b' def attach_context_attributes(context, r'
379 379 "sideside": "sideside"
380 380 }.get(request.GET.get('diffmode'))
381 381
382 is_api = hasattr(request, 'rpc_user')
382 if is_api is not None:
383 is_api = hasattr(request, 'rpc_user')
383 384 session_attrs = {
384 385 # defaults
385 386 "clone_url_format": "http",
@@ -119,7 +119,10 b' def send_exc_email(exc_id, exc_type_name'
119 119 log.debug('Sending Email exception to: `%s`', recipients or 'all super admins')
120 120
121 121 # NOTE(marcink): needed for email template rendering
122 attach_context_attributes(TemplateArgs(), request, request.user.user_id)
122 user_id = None
123 if request:
124 user_id = request.user.user_id
125 attach_context_attributes(TemplateArgs(), request, user_id=user_id, is_api=True)
123 126
124 127 email_kwargs = {
125 128 'email_prefix': app.CONFIG.get('exception_tracker.email_prefix', '') or '[RHODECODE ERROR]',
General Comments 0
You need to be logged in to leave comments. Login now