fix(ci): pin smtp4dev (#32035)
* fix(ci): pin smtp4dev New version seems to break something.
This commit is contained in:
parent
9d56a31ac3
commit
94e575b5d0
5 changed files with 35 additions and 65 deletions
2
.github/workflows/_base-server-tests.yml
vendored
2
.github/workflows/_base-server-tests.yml
vendored
|
|
@ -85,7 +85,7 @@ jobs:
|
|||
env:
|
||||
POSTGRES_PASSWORD: ${{ env.DB_ROOT_PASSWORD }}
|
||||
smtp_server:
|
||||
image: rnwood/smtp4dev
|
||||
image: rnwood/smtp4dev:3.7.1
|
||||
ports:
|
||||
- 2525:25
|
||||
- 3000:80
|
||||
|
|
|
|||
|
|
@ -32,12 +32,6 @@ frappe.ui.form.on("DocType", {
|
|||
},
|
||||
|
||||
refresh: function (frm) {
|
||||
if (frm.doc.custom === 1) {
|
||||
frm.add_custom_button(__("Trim Table"), function () {
|
||||
frm.trigger("trim_table");
|
||||
});
|
||||
}
|
||||
|
||||
frm.set_query("role", "permissions", function (doc) {
|
||||
if (doc.custom && frappe.session.user != "Administrator") {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -1058,17 +1058,6 @@ class DocType(Document):
|
|||
)
|
||||
return True
|
||||
|
||||
@frappe.whitelist()
|
||||
def trim_table(self):
|
||||
from frappe.model.meta import trim_table
|
||||
|
||||
"""Removes database fields that don't exist in the doctype.
|
||||
|
||||
This may be needed as maintenance since removing a field in a DocType
|
||||
doesn't automatically delete the db field.
|
||||
"""
|
||||
trim_table(self.name, dry_run=False)
|
||||
|
||||
|
||||
def validate_series(dt, autoname=None, name=None):
|
||||
"""Validate if `autoname` property is correctly set."""
|
||||
|
|
|
|||
|
|
@ -202,6 +202,40 @@ frappe.ui.form.on("Customize Form", {
|
|||
);
|
||||
},
|
||||
|
||||
async trim_table(frm) {
|
||||
let dropped_columns = await frappe.xcall(
|
||||
"frappe.custom.doctype.customize_form.customize_form.get_orphaned_columns",
|
||||
{ doctype: frm.doc.doc_type }
|
||||
);
|
||||
|
||||
if (!dropped_columns?.length) {
|
||||
frappe.toast(__("This doctype has no orphan fields to trim"));
|
||||
return;
|
||||
}
|
||||
let msg = __(
|
||||
"Warning: DATA LOSS IMMINENT! Proceeding will permanently delete following database columns from doctype {0}:",
|
||||
[frm.doc.doc_type.bold()]
|
||||
);
|
||||
msg += "<ol>" + dropped_columns.map((col) => `<li>${col}</li>`).join("") + "</ol>";
|
||||
msg += __("This action is irreversible. Do you wish to continue?");
|
||||
|
||||
frappe.confirm(msg, () => {
|
||||
return frm.call({
|
||||
doc: frm.doc,
|
||||
method: "trim_table",
|
||||
callback: function (r) {
|
||||
if (!r.exc) {
|
||||
frappe.show_alert({
|
||||
message: __("Table Trimmed"),
|
||||
indicator: "green",
|
||||
});
|
||||
frappe.customize_form.clear_locals_and_refresh(frm);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
setup_export(frm) {
|
||||
if (frappe.boot.developer_mode) {
|
||||
frm.add_custom_button(
|
||||
|
|
|
|||
|
|
@ -222,51 +222,4 @@ frappe.model.DocTypeController = class DocTypeController extends frappe.ui.form.
|
|||
update_fieldname_options();
|
||||
}
|
||||
}
|
||||
|
||||
async trim_table() {
|
||||
let frm = this.frm;
|
||||
let doctype = null;
|
||||
if (frm.doc.doctype === "DocType") {
|
||||
doctype = frm.doc.name;
|
||||
} else {
|
||||
// In customize form name field is "Customize Form". Doctype name is stored in doc_type.
|
||||
doctype = frm.doc.doc_type;
|
||||
}
|
||||
|
||||
let dropped_columns = await frappe.xcall(
|
||||
"frappe.custom.doctype.customize_form.customize_form.get_orphaned_columns",
|
||||
{ doctype: doctype }
|
||||
);
|
||||
|
||||
if (!dropped_columns?.length) {
|
||||
frappe.toast(__("This doctype has no orphan fields to trim"));
|
||||
return;
|
||||
}
|
||||
let msg = __(
|
||||
"Warning: DATA LOSS IMMINENT! Proceeding will permanently delete following database columns from doctype {0}:",
|
||||
[frm.doc.name.bold()]
|
||||
);
|
||||
msg += "<ol>" + dropped_columns.map((col) => `<li>${col}</li>`).join("") + "</ol>";
|
||||
msg += __("This action is irreversible. Do you wish to continue?");
|
||||
|
||||
frappe.confirm(msg, () => {
|
||||
return frm.call({
|
||||
doc: frm.doc,
|
||||
method: "trim_table",
|
||||
callback: function (r) {
|
||||
if (!r.exc) {
|
||||
frappe.show_alert({
|
||||
message: __("Table Trimmed"),
|
||||
indicator: "green",
|
||||
});
|
||||
if (frm.doc.doctype === "DocType") {
|
||||
frm.refresh();
|
||||
} else {
|
||||
frappe.customize_form.clear_locals_and_refresh(frm);
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue