from functools import wraps

from flask import current_app, request


def minifiable(f):
    @wraps(f)
    def wrapped_f(*args, **kwargs):
        format_ = request.args.get('format')
        if format_ == 'json':
            current_app.config['JSONIFY_PRETTYPRINT_REGULAR'] = False

        return f(*args, **kwargs)

    return wrapped_f

from functools import wraps

from flask import current_app, request


def minifiable(f):
    @wraps(f)
    def wrapped_f(*args, **kwargs):
        current_app.config['JSONIFY_PRETTYPRINT_REGULAR'] = \
            request.args.get('format') != 'json'

        return f(*args, **kwargs)

    return wrapped_f

Set minify to False as well as sometimes setting it to True.
Set minify to False as well as sometimes setting it to True.

  from functools import wraps
  
  from flask import current_app, request
  
  
  def minifiable(f):
      @wraps(f)
      def wrapped_f(*args, **kwargs):
-         format_ = request.args.get('format')
-         if format_ == 'json':
-             current_app.config['JSONIFY_PRETTYPRINT_REGULAR'] = False
+         current_app.config['JSONIFY_PRETTYPRINT_REGULAR'] = \
+             request.args.get('format') != 'json'
  
          return f(*args, **kwargs)
  
      return wrapped_f
  
Set minify to False as well as sometimes setting it to True.
## Code Before:
from functools import wraps

from flask import current_app, request


def minifiable(f):
    @wraps(f)
    def wrapped_f(*args, **kwargs):
        format_ = request.args.get('format')
        if format_ == 'json':
            current_app.config['JSONIFY_PRETTYPRINT_REGULAR'] = False

        return f(*args, **kwargs)

    return wrapped_f

## Instruction:
Set minify to False as well as sometimes setting it to True.
## Code After:
from functools import wraps

from flask import current_app, request


def minifiable(f):
    @wraps(f)
    def wrapped_f(*args, **kwargs):
        current_app.config['JSONIFY_PRETTYPRINT_REGULAR'] = \
            request.args.get('format') != 'json'

        return f(*args, **kwargs)

    return wrapped_f
