Commit graph

211 commits

Author SHA1 Message Date
Ankush Menat
d389fffbb7
feat: inter-process file locks (#19133) 2022-12-06 16:31:51 +05:30
Ankush Menat
70633573c2
fix: dont convert row format if not required (#18900) 2022-11-16 20:48:50 +05:30
Ankush Menat
ad7c0816f8
fix: prevent deleting standard doctypes in prod (#18803) 2022-11-08 21:27:41 +05:30
phot0n
51ac3e8a99 fix: sync app dashboard on app install
* chore: fix sync_dashboards' docstring
2022-09-12 00:01:21 +05:30
Nabin Hait
395caebd5a fix: init only existing single doctypes 2022-08-11 17:10:55 +05:30
Gavin D'souza
71b5c77e6e Merge branch 'develop' of github.com:frappe/frappe into mariadb-client-refactor 2022-07-05 14:55:02 +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
cf699fe40b Merge branch 'develop' of github.com:frappe/frappe into mariadb-client-refactor 2022-06-29 13:49:18 +05:30
Ankush Menat
d35d7ffbe2 fix: remove bare exception catching
A bare except catches lots of things (like generator iteration end) and should never be used.
2022-06-28 18:05:00 +05:30
Gavin D'souza
b4578dc632 Merge branch 'develop' of github.com:frappe/frappe into mariadb-client-refactor 2022-06-15 16:40:29 +05:30
Ankush Menat
82cc98366d fix: dont attempt to init singles that dont exist
This is done during app install stage and causes unnecessary failures
where stale doctypes are left in db.
2022-05-29 13:46:48 +05:30
gavin
73c3db12ee refactor(minor): Move internal util to the module where it's used 2022-05-24 19:19:53 +05:30
phot0n
ef99b57a08 chore: use secho instead of raising exception if app is already installed
* chore: singular click import
2022-05-11 16:18:14 +05:30
phot0n
fc6093515d chore: add comments and add force flag to more places 2022-05-11 16:18:14 +05:30
chillaranand
d2b63d0935 feat: Added force flag to install-app command 2022-05-11 16:18:14 +05:30
Ankush Menat
dad19e2c3f fix: required_apps blocks app install 2022-04-13 13:51:51 +05:30
Ankush Menat
8269e8dd47 fix: ignore duplicate modules during install 2022-04-13 13:03:09 +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
ChillarAnand
7c46736654 fix: Use app name for parsing app name 2022-04-06 12:26:26 +05:30
ChillarAnand
112593fb5f fix: Use github.com when github api rate is crossed 2022-04-01 12:05:04 +05:30
saxenabhishek
f8c4098585 docs: docstings and refs 2022-03-22 14:17:01 +05:30
saxenabhishek
c53e6d822d feat: parse app name from tags and urls 2022-03-22 14:16:59 +05:30
Gavin D'souza
14a4e35d8d fix: Typo in is_downgrade's user warning
Fixes https://github.com/frappe/frappe/issues/16312
2022-03-17 09:51:00 +05:30
Revant Nandgaonkar
cdc6bcadb1
fix(cli): Database agnostic options for root db credentials (#15973)
* fix(bench): new-site params for root db credentials

allow root credentials for postgresql
use common cli option name for both database types

* fix(bench): backward compatible db params

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

* fix(bench): use common db cred params

use --db-root-username and --db-root-password

* feat(bench): add --set-default to bench new-site

* fix: do not set default root user

* fix: indentation

Co-authored-by: gavin <gavin18d@gmail.com>
2022-02-25 09:58:59 +05:30
barredterra
745297a49d refactor: a not in b
Search: if not ([\w\d]*?) in ([\w\d]*?)
Replace: if $1 not in $2
2022-02-21 19:54:34 +01:00
ChillarAnand
0a1cd9e623 fix: Removed verbose flag for gzip 2022-02-17 15:43:07 +05:30
Ankush Menat
fd227d38f4
feat: post model-sync patches (#15351)
Ability to run a few patches after the doctype model schema is synced.

Read module-level docstring of patch_handler.py for more info.
2022-01-26 11:21:30 +05:30
barredterra
dac9349aef refactor: use is bool instead of == bool 2022-01-17 15:40:33 +01:00
phot0n
1d879f741b feat: before_uninstall and after_uninstall hooks 2021-12-20 14:05:10 +05:30
Raffael Meyer
c5df17e356
fix: cannot uninstall app with virtual doctype (#15136)
* Update installer.py

* fix: Drop table only if it exists

* revert: "Update installer.py"

This reverts commit 0e8370ede8a9c2b1c0687e5c216ecf67566da0f5.

Co-authored-by: Suraj Shetty <surajshetty3416@gmail.com>
2021-12-03 14:34:41 +00:00
Gavin D'souza
2e28ee5b25 fix: Update Installed Applications on remove_app
Removing an app from a site should sync the Installed Applications
doctype
2021-11-15 12:10:50 +05:30
Gavin D'souza
30c39acabe fix: Don't unlink file blindly
This made sense with the missing_ok. But now, a try-except seems
unnecessary too. Also, possibly destructive. Best to stray away from
these things.
2021-10-18 12:07:42 +05:30
Gavin D'souza
f51b1cc739 fix: Remove unnecessary missing_ok kwarg from unlink
missing_ok added in PY38, this change breaks installs for PY37. ref: https://docs.python.org/3/library/pathlib.html#pathlib.Path.unlink
2021-10-18 11:51:33 +05:30
Ankush Menat
a6bfbe4f1a
Merge pull request #14427 from ankush/app_uninstall_failure
fix: app uninstallation failure if module def link field isn't called "module"
2021-10-13 16:38:18 +05:30
Ankush Menat
70fcac8acf
refactor: change _delete_modules for testability 2021-10-12 17:10:14 +05:30
Ankush Menat
aa372b0990
fix: change order of deletion
Previous order was:
1. Delete DocTypes
2. Delete linked records
3. Drop tables

Now if linked records belonged to deleted doctypes it causes
uninstallation failure.

Changed order to:

1. Delete linked records
2. Delete DocTypes
3. Drop tables
2021-10-12 16:52:18 +05:30
Ankush Menat
412aa9f5cc
fix: fieldname for linkfield hardcoded to "module"
Remove_app assumed that all link fileds linking to "Module Def" are
called "module", this causes uninstall failure and leaves bench in
pseudo-irrecoverable state. (requiring some manual cleanup)
2021-10-12 16:52:18 +05:30
Ankush Menat
ae88fca3ef
refactor: split remove_app in smaller functions 2021-10-12 16:52:17 +05:30
abhishek
69d8eddf5a refactor: remove unused args
refactor: remove unused args
2021-10-11 17:23:17 +05:30
Gavin D'souza
e245c8da09 fix: Don't load entire db file into memory
Cleaning up my own mess :')
Read and write entire SQL file line by line
2021-10-08 18:15:12 +05:30
Pruthvi Patel
f2cf8981b5 fix: get abs path 2021-10-04 17:59:34 +05:30
Sagar Vora
cbbfdf33de fix: use site path instead of site name to generate DB name 2021-10-04 17:49:21 +05:30
Gavin D'souza
f1d2886328 Merge branch 'develop' of github.com:frappe/frappe into mariadb-10_6 2021-09-14 22:10:24 +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
Gavin D'souza
41b30b7442 feat: Handle site restores to MariaDB 10.6 2021-08-30 12:26:18 +05:30
Suraj Shetty
7dfced5047 Merge branch 'develop' of https://github.com/frappe/frappe into refactor-website 2021-06-17 09:48:50 +05:30
Gavin D'souza
c489846547 Merge branch 'develop' into unnecessary_comprehensions 2021-06-11 19:30:23 +05:30
Suraj Shetty
e6d701b038 refactor: Use clear_website_cache instead of clear_cache 2021-05-25 15:02:18 +05:30
Suraj Shetty
86897c1808 refactor: Remove render.py and move all utility functions to utils.py
- Replace or remove all render imports
2021-05-25 10:53:35 +05:30
Ankush Menat
4754ab71d1
perf(minor): remove unnecessary comprehensions
- remove several unnecessary comprehensions from functions that accept a generator.
- Using `[x for x in iter]` causes a list to be built first then passed to the outer function.
- `any` and `all` can take generator instead. This makes memory usage O(1) and actually makes these functions short-circuiting. E.g. if the first condition fails then `all` will immediately return false instead of evaluating all the entries.
- `sum`, `min`, `max` => memory usage become O(1)
- `list`, `set`, `.join()` => roughly halves memory usage, as list is not required to be built.
- lastly, it's two fewer characters to read/think about.
2021-05-12 20:38:18 +05:30