-
Notifications
You must be signed in to change notification settings - Fork 90
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
Only allow certain types to be attached #3
Comments
I don't like "" for "everything". None as a default value makes more sense. Why raising an IntegrityError and overwriting the save method? It's already checked in the form. |
I'll switch to None :) As for overriding the save() method, there we have model validation, while in the form it only checks on the upload form. You can still attach other types from shell etc. |
What should '' mean? If a user chooses to set: ATTACHMENTS_ALLOWED_TYPES = '' |
I dont see the need for validation on model level, if the admin does that from the shell, he should take care of it. I'm fine with the form validation but I have some minor nits how it's currently done. I try to add this feature asap and leave that file open. |
Fine, let's ditch the validation at the model level :) |
I've published a branch[1] on launchpad which includes this update and a way to limit the total size of attachments per model here: |
I didn't heard of a need for this in teh past, I'm going to close this. Thank you. |
@bartTC I have a similar albeit different requirement. Is there currently a way to restrict which file types can be attached (globally or per model/form)? If not can you point me to a way to work around it? |
A patch that allows users to specify the type of files that can be attached:
ATTACHMENTS_ALLOWED_TYPES = '.jpg .png .jpeg .gif .bmp'
'' is special and everything can be attached.
http://panos.solhost.org/temp/allowed_types.patch
The text was updated successfully, but these errors were encountered: