Commit graph

146 commits

Author SHA1 Message Date
Aditya Hase
f3b959b1fe frappe: refactor async to realtime (#6015)
* frappe: refactor async to realtime

* frappe: refactor async to is_async
2018-08-28 15:31:20 +05:30
Himanshu Mishra
10361383c1 [fix]: use is_async in background jobs instead of async (#5986) 2018-08-20 10:36:26 +05:30
Rushabh Mehta
b1857a5132
optimize(meta): meta is now cached in redis (#5948)
* optimize(meta): meta is now cached in redis

* fix(meta): test fixes

* fix(meta): codacy

* fix(meta): allow nulls to be serialized

* fix(form_meta): fix form meta caches

* fix(form_meta): fix form meta caches

* fix(form_meta): don't cache for developer_mode'
2018-08-09 11:24:42 +05:30
Nabin Hait
8d32749971 [optimize] db exists 2018-08-08 18:34:33 +05:30
Rushabh Mehta
cbbca735b9 fix(database): fetch description only if results 2018-08-08 16:52:40 +05:30
Rushabh Mehta
e7c8b0c138 optimize(various): optimize with frappe.get_cached_value 2018-08-08 16:33:40 +05:30
Nabin Hait
7f2a14bdf1 feat(document): frappe.get_cached_doc 2018-08-08 13:04:23 +05:30
Prateeksha Singh
4d96fcc557 [query-perf-log] Add execution time for debug opt in frappe.db.sql (#5592)
* [query-perf-log] Add execution time for debug opt in frappe.db.sql

* Update database.py
2018-05-23 10:41:05 +05:30
Suraj Shetty
95c02f94ef Nested permission (#5460)
* nested permission

* test for nested permission

* [minor] Format code

* Fix nested permission test

* Fix codacy
2018-04-20 18:07:55 +05:30
Nabin Hait
82f1058ad4 Merge branch 'master' into develop 2018-04-04 11:23:21 +05:30
Suraj Shetty
0be4342649 User permissions redux (#5314)
* [start] removing simpler user permission structure

* permission changes
removed "apply user permission" from has_permission

* test fixes and other supporting fixes

* Removed Apply user permission code

* additional check to see if user has some user permissions related to a doctype

* test fixes

* removed a test

* Permission changes
- Code to restrict access if module is blocked for user.
- [Fix] ignore user perm if applicable

* List view restrictions ui changes

* removed unwanted apply user perm code

* permission (block module fix)

* permission fix

* change user permission
user permission will not be applied if user doesn't have role permission

* removed left "apply_user_permissions" property

* add user permission help template

* perm js refactor

* ui / ux changes
restrict list view before entering view if user is not permitterd
add description for if owner check in role permission manager

* codacy fixes

* permission code fix
add controller permission check
add blocked module check in build_permission

* optimized get blocked module method
2018-04-03 10:42:04 +05:30
Rushabh Mehta
d6f09c5325
[optimize] frappe.db.count with cache (#5355) 2018-04-02 19:24:41 +05:30
Achilles Rasquinha
c973394bce fix cast singles 2018-04-02 16:06:21 +05:30
Achilles Rasquinha
0fc518ace4 python 3 fixes 2018-03-31 18:15:43 +05:30
Achilles Rasquinha
6598be192f cast for standard fieldnames 2018-03-31 14:57:42 +05:30
Achilles Rasquinha
569732e7c8 fix in case doctype not found 2018-03-29 14:26:20 +05:30
Achilles Rasquinha
bb58bd8d19 fix in case doctype not found 2018-03-29 14:24:59 +05:30
Achilles Rasquinha
ddd226c1a1 fix in case doctype not found 2018-03-29 14:23:11 +05:30
Achilles Rasquinha
608b3972ef move helper outside class definition 2018-03-29 11:41:46 +05:30
Achilles Rasquinha
5a3682a586 fix codacy 2018-03-29 11:27:51 +05:30
Achilles Rasquinha
d4afe75e7e return immutable 2018-03-29 11:14:52 +05:30
Achilles Rasquinha
3d0064332c get_meta alternative 2018-03-29 11:02:53 +05:30
Achilles Rasquinha
8b5d24f89a fix minor variable call 2018-03-29 10:21:00 +05:30
Achilles Rasquinha
05ad109bcb cast singles fieldtype 2018-03-29 09:56:44 +05:30
Achilles Rasquinha
bc0a2acadf fix timedelta conversions for pymysq 2018-03-22 23:02:20 +05:30
Achilles Rasquinha
84e7f8ba67 fix timedelta conversions for pymysq 2018-03-22 22:52:20 +05:30
Nabin Hait
764c5e2167 Fixed merge conflict 2018-02-23 16:58:01 +05:30
Rushabh Mehta
f20da41bf6 [fix] rename custom fields before sync if name conflicts (#5062)
* [fix] rename custom fields before sync if name conflicts

* [minor] re-add text_type

* Update doctype.py
2018-02-23 11:10:21 +05:30
Nabin Hait
d66e3c50c2 Merge branch 'master' into develop 2018-02-07 16:03:29 +05:30
Faris Ansari
1c24dae099
[hotfix] Docname as int (#4976)
* [hotfix] Docname passed as number

* typo
2018-02-07 12:29:10 +05:30
Aditya Hase
8c525fc5d4 Python 3 compatibility Frappe installation fixes (#4863)
* Use consistent indentation

* Fix print syntax

* Pass unicode argument to pymysql.escape_string
2018-01-18 13:52:46 +05:30
sharath.c
464e53f57c Local Infile param added to pymysql client to handle LOCAL keyword in custom BULK CSV's Import
Set local_infile = 1 in site_config for the pymsql to connect with LOCAL enabled state
> bench set_config local_infile 1
2018-01-04 11:52:29 +05:30
Achilles Rasquinha
b8825ca116 Pure Python MySQL instead mysqlclient (with Python C API) (#4280)
* added PyMYSQL instead mysqlclient-python

* added pymysql import

* fixed db module import

* foxed self._conn wrapper

* updated cursor migration

* removed existent converters

* some more fixes towards API port

* modified travis

* updated doctype and revereted yml

* modified travis

* refreshed logging

* raw fix

* moved from hard coded constants to declarable instances

* moved from hard coded constants to declarable instances

* refactoring and logging

* moved to global import declaration

* fixed codacy

* unfixed codacy

* minor fix

* binary_type has a single

* deprecated alternative

* merged with latest

* fixed merge conflicts

* using deprecated alternative

* raw fix

* stupid fix

* using StringTypes instead

* brutal hack

* log

* tundebazy to the rescue

* fixed content_hash error

* frappe/database.py

* frappe/database.py

* updated database.py

* updated requirements

* updated requirements

* fixed codacy

* fixed codacy

* moved from DatabaseOperationalError to pymysql.InternalError

* moved from DatabaseOperationalError to pymysql.InternalError

* fixed codacy

* empty commit

* fixed codacy

* fixed codacy
2017-11-06 16:42:01 +05:30
Revant Nandgaonkar
4df6135c3c enqueue_after_commit option added to frappe.enqueue (#4167)
* enqueue_after_commit option added to frappe.enqueue

* Fixes

Codacy https://www.codacy.com/app/frappe/frappe/pullRequest?prid=934733
clear frappe.flags.enqueue_after_commit after executing enqueued jobs

* sync_global_search() uses enqueue_after_commit=True

* Update database.py

* webhooks enqueue after commit

* Update __init__.py
2017-10-18 11:43:02 +05:30
Aditya Hase
79b2b93958 Pass positional arguments instead of keyword arguments to MySQLdb.connect 2017-09-04 16:05:57 +05:30
Aditya Hase
cd9c357d2b Covert filter to list before checking it's length 2017-09-04 16:05:57 +05:30
Aditya Hase
06d9bd0a1f Explicitly convert dict.keys() to list 2017-08-22 18:18:50 +05:30
Rushabh Mehta
ce48aaa2c9 Merge branch 'develop' into fix-long 2017-08-11 12:59:02 +05:30
Aditya Hase
69c255661d Replaced long with six.integer_types 2017-08-11 00:32:26 +05:30
Aditya Hase
769338f136 Replaced all instances of basestring with six.string_types 2017-08-11 00:10:11 +05:30
mbauskar
e4675498bb Merge branch 'master' into staging 2017-08-04 11:02:07 +05:30
Nabin Hait
b524d892f7 Add where clause only if conditions exists (#3853) 2017-08-03 17:02:47 +05:30
Aditya Hase
7c9c53840a Replaced types import with six (#3834)
Importing six.text_type instead of types.UnicodeType and
six.binary_type instead of types.StringType
2017-08-02 17:04:56 +05:30
Aditya Hase
e6bd1e4995 Replaced all instances of 'unicode' with 'six.text_type' (#3825) 2017-08-02 16:57:39 +05:30
felixvarghese
f189829240 Allow SSL connections to a remote database server (#3742)
* Allow SSL connections to a remote database server

Add the following options in site_config.json to use ssl

- "db_ssl_ca" = "/path/to/ca/cert.pem"
- "db_ssl_cert" = "/path/to/ssl/cert.pem"
- "db_ssl_key" = "/path/to/ssl/key.pem"

The files mentioned should be stored on the App server in the location mentioned.

This commit allows for basic ssl connections. X509 is still not supported.

If the above options are not set, the connection will not use an encrypted connection, and connect normally.

* docs - Allow SSL to remote database host
2017-07-20 18:00:02 +05:30
Rushabh Mehta
45cbb7facc [minor] cleanups and optimization fixes 2017-06-20 12:46:43 +05:30
tundebabzy
bbde2ec4cf rewrite use of dict.iteritems (#3498)
* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility
2017-06-19 09:10:21 +05:30
Prateeksha Singh
d8fb2c2c0d [fix] Enqueue syncing global search (#3455)
* [fix] Enqueue syncing global search

* make passing flags optional

* Create global_search.py
2017-06-16 11:02:22 +05:30
tundebabzy
6fbe20caaa Except and raise statement python 3 compatible style (#3216)
* changes exception and raise statements to python 3 style

* changes except statement to python 3 style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* adds six.reraise to fix python 3 style raise statements with traceback

* fixes indentation
2017-05-11 10:51:59 +05:30
Rushabh Mehta
ba289eaa62 [minor] remove print 2017-03-15 15:31:16 +05:30