-
Notifications
You must be signed in to change notification settings - Fork 95
MAX_SIZE minor bug fix #99
base: master
Are you sure you want to change the base?
Changes from 3 commits
abe7caf
b40ec53
716c248
874af06
f2869c3
0b0e3c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,6 +85,9 @@ target/ | |
| # pyenv | ||
| .python-version | ||
|
|
||
| #pycharm | ||
| .idea | ||
|
|
||
| # celery beat schedule file | ||
| celerybeat-schedule | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,7 +80,8 @@ def _check_media(self, media): | |
| """ | ||
| Checks whether the given MessageMedia should be downloaded or not. | ||
| """ | ||
| if not media or not self.max_size: | ||
| # It is needed to chek the size with the max_size defined in config file | ||
| if not media or media.document.size > self.max_size: | ||
|
||
| return False | ||
| if not self.types: | ||
| return True | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This bypasses the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it is if you check the config file, it says "Setting to "0" will not download any media."
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, that's not what I meant. I mean, if there are no types (i.e. "all media is valid"), the maximum size is not checked at all.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's right, So the file size should be checked before this line! |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This belongs in your global
.gitignore, so please undo this change.