Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with file extension in file subproblem #1017

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thremilien
Copy link
Contributor

The code isn’t removing extra spaces when splitting the file extensions. So if you input something like ".pdf, .png", it ends up with " .png" (with a space) instead of just ".png". Because of this, files with the ".png" extension won’t be recognized properly.

@@ -236,7 +236,7 @@ def parse_problem(self, problem_content):
if problem_content["allowed_exts"] == "":
del problem_content["allowed_exts"]
else:
problem_content["allowed_exts"] = problem_content["allowed_exts"].split(',')
problem_content["allowed_exts"] = [extension.strip() for extension in problem_content["allowed_exts"].split(',')]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
problem_content["allowed_exts"] = [extension.strip() for extension in problem_content["allowed_exts"].split(',')]
problem_content["allowed_exts"] = problem_content["allowed_exts"].replace(" ", "").split(',')

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than that, looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants