Commit graph

100 commits

Author SHA1 Message Date
Ankush Menat
909457de3d
fix: PDF and raw response (#22402) 2023-09-13 16:42:49 +00:00
Ankush Menat
0eb509aac3
refactor: Correct Content-Disposition headers (#22383) 2023-09-13 12:57:14 +05:30
ViralKansodiya
b0bb9a55d5
fix: error while export a doctype report in excel (#22376)
* fix: error while export a doctype report in excel

* Update frappe/utils/response.py

---------

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2023-09-13 12:13:31 +05:30
barredterra
b553ed98d8 refactor: inline immediately returned variable
Inline a variable to a return in the case when the
variable being declared is immediately returned
2023-08-08 18:09:49 +02:00
Ankush Menat
6e94cd2eb9
fix: Guess most likely exception source (#21827) 2023-07-27 17:30:04 +05:30
Sagar Vora
5f0707c856 chore: remove unused variable 2023-07-23 15:10:37 +05:30
Ankush Menat
3f142c1dce fix: respect system setting for tracebacks
closes https://github.com/frappe/frappe/issues/19826
2023-07-16 19:18:16 +05:30
Ankush Menat
8485ac5d62 build(deps): bump many dependencies
test: change code to adapt to new werkzeug client

fix: avoid setting charset

utf8 is default and assumed now by werkzeug, setting this manually is
deprecated.

fix: use string instead of bytes for setting headers

DeprecationWarning: Passing bytes as a header value is deprecated and will not be supported in Werkzeug 3.0.
12:23:34 web.1         |   response.headers["X-Page-Name"] = path.encode("ascii", errors="xmlcharrefreplace")
2023-06-10 20:47:27 +05:30
Sagar Vora
9cf7f2b311 perf: get all file data at once when downloading private file 2023-04-27 16:12:02 +05:30
Gavin D'souza
ef82ef944e fix: build_response for re.Match 2022-12-27 14:17:09 +05:30
Ankush Menat
6d264b149a fix: serialize function objects to their repr 2022-09-12 11:49:25 +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
013c2543bd refactor: frappe.utils.response.download_private_file 2022-04-18 12:54:10 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
Gavin D'souza
8037866dc1 fix: Handle parsing and formatting timedeltas
* Added utils parse_timedelta, format_timedelta
* Added to json_handler for de-serializing timedelta objects
2022-01-28 18:33:03 +05:30
Conor
40ba1ac9ba fix: Postgres Compatibility
* Handle inconsistencies in type handling in DatabaseQuery & Database
  APIs
* Update incompatible queries with frappe.qb notation
* Fixed use cases discovered by failing ERPNext CI tests

fix: db independent syntax for user_type

fix: handle postgres datetime values

feat: add ability to auto commit on db inserts

feat: add ability to escape underscore in postgres

fix: handle missing data in test runner bootstrapping

fix: db independent syntax for queries

fix: refactor to use qb

fix: update cache for language

fix: use pluck in email_queue

Co-authored-by: gavin <gavin18d@gmail.com>

fix: don't auto insert on tests for make_property_setter

fix: remove auto_commit in custom_field insertion

fix: remove auto_commit functionality

fix: review comments

fix: revert link validation

fix: style suggestion for readability

Co-authored-by: gavin <gavin18d@gmail.com>

fix: revert .lower() in link validation

fix: add rollback for setup_wizard

Revert "fix: add rollback for setup_wizard"

This reverts commit 83b3b0913db17718ccd5edae01858cff15603829.

Revert "feat: add ability to escape underscore in postgres"

This reverts commit 8ed9c2aa3306438e94bb813f60e65b416d0b947b.

fix: more concise representation of order fields

Co-authored-by: gavin <gavin18d@gmail.com>
2022-01-07 10:44:57 +05:30
Ankush Menat
ecca7f287e
chore: better message for system updates (#15154)
closes https://github.com/frappe/frappe/issues/10997

[skip ci]
2021-12-02 11:09:33 +05:30
Gavin D'souza
125233315f fix: errprint only if traceback? 2021-10-26 17:33:03 +05:30
Saqib Ansari
4f288db878 refactor: handle exception messages on client side 2021-10-19 20:00:35 +05:30
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30
Suraj Shetty
2d8c6c1710 Merge branch 'develop' of https://github.com/frappe/frappe into refactor-website 2021-06-03 11:43:28 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* Remove six for PY2 compatability since our dependencies are not, PY2
  is legacy.
* Removed usages of utils from future/past libraries since they are
  deprecated. This includes 'from __future__ ...' and 'from past...'
  statements.
* Removed compatibility imports for PY2, switched from six imports to
  standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
  versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
2021-05-26 15:31:29 +05:30
Suraj Shetty
56ee6e449c refactor: Remove render method
- also, move clear cache to utils.py
2021-05-14 14:17:52 +05:30
Suraj Shetty
e18a43e11d fix: Replace render() with get_response 2021-04-28 12:51:36 +05:30
Aditya Hase
09b87f8a2d
perf: Remove frappe.website.render from import tree 2021-02-21 09:47:05 +05:30
Faris Ansari
6fa38a325d fix: Fallback value for allow_traceback when no db 2021-02-16 21:45:26 +05:30
Karthikeyan Singaravelan
0d4f116b3e fix: Import ABC from collections.abc for Python 3.9 compatibility. 2020-11-26 13:17:12 +00:00
ABHISHEK KEDAR
7afb5b0b73
feat: as_raw update to display content inline not always download as attachment (#11569)
* feat: as_raw update to display content inline not always download as attachment

* fix: string formatting corrected in as_raw()

* fix: missing quotes in filename in as_raw()
2020-10-30 06:58:25 +00:00
prssanna
89e0a9804b fix: add missing fullstop in system update message 2020-04-19 22:13:10 +05:30
Rohit Waghchaure
80f87a37fb fix: not able to download XML file 2019-12-07 12:53:04 +05:30
Aditya Hase
ab455b46cd
fix(pdf): Remove unnecessary argument
https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote
https://docs.python.org/2/library/urllib.html#urllib.quote
2019-11-15 15:44:39 +05:30
IOWEB TECHNOLOGIES
a4585bfcd9 add support for utf-8 characters in pdf filename during downloads 2019-10-29 23:33:23 +02:00
gavin
b5ab59ad6e feat: Access log (#8014)
* feat: Access log doctype for logging information about private file
downloads, backups downloads, printing and exporting data

* updated: access log

* updated: formattted access_log.js

* access logging: print/pdf/pvt files/export/backup

client side implementation: treeview, query_report
server side implementation on the rest

* fixes: codacy errors

* Update response.py

* Update response.py

* Update response.py

* codacy: please

* travis fixes

* changes:filters=>_filters(lol this works @ times?)

added: tests for access_log, make_access_log formatting, form ui added
buttons

* this hopefully fixes em tests

* changes: fixed indents, session.user, formatting

* fixes: tests, refactor, permissions

emerging from exporter.py => reference doctype in export_data (check
format!)

* fixes: convert dict to json

* changes: added more tests, wrote lesser code?

switched js to display depends on

* fixes: codacy and hopefully travis

* fix: tests? and polishing up

* added column field, removed tracked views

changed access log in exporter.py > export_data
added access log in reportview.py > export_query

* style: Fix indentation

* style: Fix indentation

* fix: Remove problematic string replace

It may replace quotes in the actual filter values which can result in invalid JSON

* fix: Remove filter string conversion

* fix: Error due to quote escapes

TODO: Check for a better way
2019-08-06 10:24:55 +05:30
Faris Ansari
fed179b4ea fix: Check private file permissions for all docs
A file may be attached to multiple documents. It's permission is decided
based on the attached document's permissions. So, the permission
should be checked for each document and should be allowed if atleast
one document is accessible.
2019-07-29 15:43:06 +05:30
Aditya Hase
6d4ec8e4d6 fix: Encode path before passing to urllib.quote (#7758) 2019-06-28 14:09:24 +05:30
jijan1985
7dfaaee1fe fix: quoting special characters and appropriately encoding non-ASCII filename (#7677) 2019-06-14 11:43:08 +05:30
Aditya Hase
5d5e68dbed fix: Do not show locals to user (#7397) 2019-05-02 19:35:17 +05:30
Frappe Bot
bd2e410a02 Merge branch 'master' into develop 2019-03-23 07:23:54 +00:00
Himanshu Mishra
d0eb066fa4
Variable bleed in response 2019-03-21 16:49:35 +05:30
Prateeksha Singh
14693b4327 feat(response): force download html or xml files 2019-03-14 08:47:02 +05:30
Frappe Bot
bfc25ad1e5 Merge branch 'master' into develop 2019-02-15 10:21:47 +00:00
Aditya Hase
683be9e096 feat(error-report): Collect frame locals in error report (#6938)
* feat(error-report): Collect frame locals in error report

* style: Linting fixes
2019-02-15 14:24:08 +05:30
Sagar Vora
17b20b22a3 Merge branch 'master' into develop 2019-02-12 16:31:54 +05:30
Saif
1bb4c6275f fix: Don't send attachment/download header with PDF files (#6881) 2019-02-06 12:48:41 +05:30
Sagar Vora
ef82f39f99 Merge branch 'staging' into develop 2019-01-29 18:24:11 +05:30
Zarrar
8bdb0dc5f8 feat: Download json file (#6793)
* feat: download file as json type

* fix: make raw type files downloadable
2019-01-23 16:51:02 +05:30
Ameya Shenoy
13524a1ad5
Merge branch 'staging' into develop 2018-11-23 08:14:29 +00:00
Juan Carlos Espinoza Zurita
7319853d58 [MINOR FEATURE] Export file to TXT #6737 (#6489) 2018-11-21 18:17:34 +05:30
Faris Ansari
b37c5153a9 fix(File): Infer File Permissions from linked doc 2018-09-26 14:40:10 +05:30
Chinmay Pai
8943f6cfd5
file-api: migration improvements and fixes
* migrate more functions to file class
* add get_content(), returns file content from file_name
* move get_file_path() to get_full_path() to decrease naming ambiguity

Signed-off-by: Chinmay Pai <chinmaydpai@gmail.com>
2018-09-06 17:30:33 +05:30