pnijhara / sih-2019

Statement not reachable on execution PYL-W0101
Anti-pattern
Critical
2 occurrences in this check
Unreachable code
 56        # submit a empty part without filename
 57        if file.filename == "":
 58            return "No file selected"
 59            return redirect(request.url) 60        if file and allowed_file(file.filename):
 61            filename = secure_filename(file.filename)
 62            file.save(os.path.join(server.config["UPLOAD_FOLDER"], filename))
Unreachable code
 50        # check if the post request has the file part
 51        if "file" not in request.files:
 52            return "No file part"
 53            return redirect(request.url) 54        file = request.files["file"]
 55        # if user does not select file, browser also
 56        # submit a empty part without filename