Commit graph

183 commits

Author SHA1 Message Date
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
Gavin D'souza
411075424e refactor(minor): Simplify site directory generation 2021-05-06 20:54:39 +05:30
Gavin D'souza
393696fa4a chore: Drop dead code
* Don't create task-logs folder during site creation
* Remove old unused async code for tracking tasks
2021-05-06 19:24:12 +05:30
Shivam Mishra
8b77346066 Merge branch 'rebrand-ui' of https://github.com/frappe/frappe into desk-enhancements 2020-12-16 13:18:48 +05:30
Gavin D'souza
1b609af8e5 fix: Handle paths relative to bench root and sites folder 2020-12-04 18:15:17 +05:30
Shivam Mishra
bd7690a9fa feat: rename desk page to workspace 2020-12-04 14:16:26 +05:30
mergify[bot]
fec3447547
Merge pull request #11969 from gavindsouza/uninstall-app-enhancements-1
fix: uninstall-app enhancements
2020-11-27 05:56:35 +00:00
mergify[bot]
3d922183c7
Merge pull request #11104 from gavindsouza/skip-backup-tables
feat: Allow skip or backup only specific DocTypes during backups
2020-11-18 09:48:14 +00:00
Gavin D'souza
51a1bf9a73 fix: Delete with force to bypass linked docs errors 2020-11-18 12:19:56 +05:30
Suraj Shetty
cc60993120
Merge branch 'develop' into installer-validate 2020-11-18 10:53:37 +05:30
mergify[bot]
c13e04b97c
Merge pull request #11911 from gavindsouza/uninstall-app-enhancements-0
fix: Uninstall app enhancements
2020-11-17 14:34:10 +00:00
Gavin D'souza
05c8e3c5a7 Merge branch 'develop' of github.com:frappe/frappe into skip-backup-tables 2020-11-13 19:44:17 +05:30
Gavin D'souza
14fe6ccfa3 fix: Add is_partial check in bench restore 2020-11-13 19:42:38 +05:30
Gavin D'souza
0f13fe7da5 fix: Validate SQL files properly 2020-11-13 15:13:55 +05:30
Gavin D'souza
c295882e05 fix: Don't overwrite same variable 2020-11-11 14:03:43 +05:30
Gavin D'souza
d28fb7ff5e fix: ignore on_trash, delete comment on dt 2020-11-10 18:44:10 +05:30
Gavin D'souza
5facf0fd1c style: Use f-strings, pluck and Black 2020-11-10 18:17:54 +05:30
Gavin D'souza
b3a487242f fix: Use get_all instead of get_list 2020-11-10 18:04:44 +05:30
Gavin D'souza
a8427c735e fix: Dont take backup in dry run + other fixes 2020-11-10 18:01:16 +05:30
Gavin D'souza
44f8c6e264 Merge branch 'develop' of github.com:frappe/frappe into skip-backup-tables 2020-11-09 19:08:36 +05:30
Gavin D'souza
19f87c36e5 fix: Marked is_downgrade function as only MariaDB compatible 2020-11-09 18:57:21 +05:30
Gavin D'souza
7b1fa59a29 feat: Restore partial backups via bench partial-restore 2020-11-09 18:51:33 +05:30
Gavin D'souza
af1ed2f0bc refactor: Move _new_site and extract_sql_from_archive from
frappe.commands.site module to frappe.installer
2020-11-09 18:50:03 +05:30
mergify[bot]
c0aae3e28e
Merge pull request #11878 from gavindsouza/validate-backup-before-restore
feat: Validate sql file before restoring site
2020-11-09 12:01:33 +00:00
Gavin D'souza
d284d38b62 Merge branch 'develop' of github.com:frappe/frappe into fix-remove-from-installed-apps 2020-11-05 18:30:38 +05:30
Gavin D'souza
94d1759041 feat: Validate sql file before restoring site 2020-11-05 13:46:12 +05:30
Gavin D'souza
14eafea887 fix: Use sql_ddl to avoid exception triggered while running drop sql 2020-10-30 17:37:00 +05:30
Gavin D'souza
823aec2d87 fix: Clear cache after updating defaults manually 2020-10-30 17:34:40 +05:30
gavin
e8ee4bd867
Merge branch 'develop' into compress-files 2020-09-22 10:56:17 +05:30