feat: allow re-running patches in developer mode
Simpler debugging.
This commit is contained in:
parent
4104e7d733
commit
3bbe4498a0
2 changed files with 14 additions and 1 deletions
|
|
@ -4,5 +4,9 @@
|
|||
frappe.ui.form.on("Patch Log", {
|
||||
refresh: function (frm) {
|
||||
frm.disable_save();
|
||||
|
||||
frm.add_custom_button(__("Re-Run Patch"), () => {
|
||||
frm.call("rerun_patch");
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,11 +4,20 @@
|
|||
# License: MIT. See LICENSE
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class PatchLog(Document):
|
||||
pass
|
||||
@frappe.whitelist()
|
||||
def rerun_patch(self):
|
||||
from frappe.modules.patch_handler import run_single
|
||||
|
||||
if not frappe.conf.developer_mode:
|
||||
frappe.throw(_("Re-running patch is only allowed in developer mode."))
|
||||
|
||||
run_single(self.patch, force=True)
|
||||
frappe.msgprint(_("Successfully re-ran patch: {0}").format(self.patch), alert=True)
|
||||
|
||||
|
||||
def before_migrate():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue