Commit graph

6 commits

Author SHA1 Message Date
Ankush Menat
4d048cd651 fix: type hint for image view
closes https://github.com/frappe/frappe/issues/19426
2023-01-02 11:50:25 +05:30
Gavin D'souza
029a1fc902 chore: Remove loose types from fn definitions 2022-12-15 13:47:05 +05:30
Gavin D'souza
2327a56abc fix(File): Correct acceptable types in APIs
- Allow str types for start, page_length in page_length API
- Allow str, list[dict] file_list in move_file API
2022-12-15 13:47:05 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +05:30
Gavin D'souza
8db6bf48f6 fix(linting): Sort imports 2022-04-18 18:17:40 +05:30
Gavin D'souza
59e45a2e2f refactor: File APIs
Restructured and moved most APIs under frappe.core.api.file namespace.
Changed some obvious security gaps (like using get_list instead of
get_all for an endpoint), styled, added type hints and made minor performance
enhancements.

Changes
* download_file API
    * Move API to handler.py
    * Check for permissions via File.is_downloadable instead
* Moved APIs to new namespace: `frappe.core.api.file`
* Backwards compatibility
    * Added APIs to override_whitelisted_methods to maintain existing
      client endpoints
    * Imported APIs to controller's namespace to avoid breaking external
      app usages
2022-03-15 19:39:47 +05:30