if "*" in TODO_LIMIT_FILE_ATTACHMENTS, allow all

This commit is contained in:
james1293 2019-07-11 11:35:01 -04:00 committed by GitHub
parent 21e0c6d656
commit d41d9887af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -127,7 +127,7 @@ def task_detail(request, task_id: int) -> HttpResponse:
name, extension = os.path.splitext(file.name)
if extension not in defaults("TODO_LIMIT_FILE_ATTACHMENTS"):
if extension not in defaults("TODO_LIMIT_FILE_ATTACHMENTS") and "*" not in defaults("TODO_LIMIT_FILE_ATTACHMENTS"):
messages.error(request, f"This site does not allow upload of {extension} files.")
return redirect("todo:task_detail", task_id=task.id)