original_docstring: Fix SENTRY_DSN for Celery.
  
      Celery does not handle threaded transport very well, so allow overriding
      default transport mechanism for Celery.
      
docstring: Fix SENTRY_DSN for Celery.
  Celery does not handle threaded transport very well, so allow overriding
  default transport mechanism for Celery.
docstring_tokens: Fix SENTRY_DSN for Celery . Celery does not handle threaded transport very well so allow overriding default transport mechanism for Celery .
code: def celery_dsn_fix(app):
      """Fix SENTRY_DSN for Celery.
  
      Celery does not handle threaded transport very well, so allow overriding
      default transport mechanism for Celery.
      """
      if app.config.get('CELERY_CONTEXT', False) and \
         app.config['LOGGING_SENTRY_CELERY'] and \
         app.config['LOGGING_SENTRY_CELERY_TRANSPORT']:
          parts = app.config['SENTRY_DSN'].split('+', 1)
          if parts[0] in ('eventlet', 'gevent', 'requests', 'sync',
                          'threaded', 'twisted', 'tornado'):
              app.config['SENTRY_DSN'] = "%s+%s" % (
                  app.config['LOGGING_SENTRY_CELERY_TRANSPORT'],
                  parts[1],
              )
          else:
              app.config['SENTRY_DSN'] = "%s+%s" % (
                  app.config['LOGGING_SENTRY_CELERY_TRANSPORT'],
                  "+".join(parts),
              )
code_tokens: def celery_dsn_fix ( app ) : if app . config . get ( 'CELERY_CONTEXT' , False ) and app . config [ 'LOGGING_SENTRY_CELERY' ] and app . config [ 'LOGGING_SENTRY_CELERY_TRANSPORT' ] : parts = app . config [ 'SENTRY_DSN' ] . split ( '+' , 1 ) if parts [ 0 ] in ( 'eventlet' , 'gevent' , 'requests' , 'sync' , 'threaded' , 'twisted' , 'tornado' ) : app . config [ 'SENTRY_DSN' ] = "%s+%s" % ( app . config [ 'LOGGING_SENTRY_CELERY_TRANSPORT' ] , parts [ 1 ] , ) else : app . config [ 'SENTRY_DSN' ] = "%s+%s" % ( app . config [ 'LOGGING_SENTRY_CELERY_TRANSPORT' ] , "+" . join ( parts ) , )
short_docstring: Fix SENTRY_DSN for Celery.
short_docstring_tokens: Fix SENTRY_DSN for Celery .
comment: """Fix SENTRY_DSN for Celery.
  
      Celery does not handle threaded transport very well, so allow overriding
      default transport mechanism for Celery.
      """