lundi 24 septembre 2018

I have if in if I think this is a bad code. How can I fix it? PYTHON

if flask.request.form['token'] == stored_token:
    if size_of_file > 10000:
        logging.info('data ' + filename + ' is compressed and sent')
        return gzip_compress(resp(200, data))
    else:
        logging.info(filename + ' data copy')
        return resp(200, data)
else:
    logging.info(' data ' + filename + ' is not compressed, but copied and sent')
    return resp(401, {})

I do not like how this code looks to help fix it. Or tell me that this is a good code.

Aucun commentaire:

Enregistrer un commentaire