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

add MARKDOWNX UPLOAD Feature #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion markdownx/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
MARKDOWNX_MEDIA_PATH,
MARKDOWNX_UPLOAD_CONTENT_TYPES,
MARKDOWNX_UPLOAD_MAX_SIZE,
MARKDOWNX_UPLOAD,
MARKDOWNX_SVG_JAVASCRIPT_PROTECTION
)

Expand Down Expand Up @@ -182,7 +183,7 @@ def clean(self):

raise MarkdownxImageUploadError.unsupported_format()

elif file_size > MARKDOWNX_UPLOAD_MAX_SIZE:
elif file_size > MARKDOWNX_UPLOAD_MAX_SIZE or not MARKDOWNX_UPLOAD:

raise MarkdownxImageUploadError.invalid_size(
current=file_size,
Expand Down
2 changes: 2 additions & 0 deletions markdownx/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def _mdx(var, default):

MARKDOWNX_UPLOAD_CONTENT_TYPES = _mdx('UPLOAD_CONTENT_TYPES', VALID_CONTENT_TYPES)

MARKDOWNX_UPLOAD = True

MARKDOWNX_IMAGE_MAX_SIZE = _mdx('IMAGE_MAX_SIZE', dict(size=(IM_WIDTH, IM_HEIGHT), quality=NINETY_DPI))

MARKDOWNX_SVG_JAVASCRIPT_PROTECTION = True
Expand Down