villebro commented on a change in pull request #8457: [fix] Improve csv upload 
functionality
URL: 
https://github.com/apache/incubator-superset/pull/8457#discussion_r339754982
 
 

 ##########
 File path: superset/views/database/forms.py
 ##########
 @@ -90,7 +90,10 @@ def at_least_one_schema_is_allowed(database):
     csv_file = FileField(
         _("CSV File"),
         description=_("Select a CSV file to be uploaded to a database."),
-        validators=[FileRequired(), FileAllowed(["csv"], _("CSV Files 
Only!"))],
+        validators=[
+            FileRequired(),
+            FileAllowed(config["ALLOWED_EXTENSIONS"], _("CSV Files Only!")),
 
 Review comment:
   Good point; the supported extensions are now included in the error message. 
I also made the extension checking case-insensitive in 
`db_engine_specs/base.py` (guessing someone will trip on an upper-case CSV/TSV 
at some point).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to