refs #5976 error extended
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2023-07-19 13:44:04 +02:00
parent f07ac89cb6
commit 2c79056f34
5 changed files with 9 additions and 14 deletions

View File

@ -178,5 +178,6 @@
"The renew period has not been exceeded": "The renew period has not been exceeded",
"You can not use the same password": "You can not use the same password",
"Valid priorities": "Valid priorities: %d",
"Negative basis of tickets": "Negative basis of tickets: {{ticketsIds}}"
"Negative basis of tickets": "Negative basis of tickets: {{ticketsIds}}",
"This ticket cannot be left empty.": "This ticket cannot be left empty. %s"
}

View File

@ -306,5 +306,5 @@
"Valid priorities": "Prioridades válidas: %d",
"Negative basis of tickets": "Base negativa para los tickets: {{ticketsIds}}",
"You cannot assign an alias that you are not assigned to": "No puede asignar un alias que no tenga asignado",
"This ticket cannot be left empty.": "Este ticket no se puede dejar vacío. %d"
"This ticket cannot be left empty.": "Este ticket no se puede dejar vacío. %s"
}

View File

@ -46,8 +46,6 @@ class Controller extends Section {
}
deleteRoadmaps() {
console.log(this.checked);
for (const roadmap of this.checked) {
this.$http.delete(`Roadmaps/${roadmap.id}`)
.then(() => this.$.model.refresh())

View File

@ -41,8 +41,8 @@ module.exports = Self => {
const isEditable = await Self.isEditable(ctx, id, myOptions);
throw new UserError(`The sales of this ticket can't be modified`);
// if (!isEditable)
if (!isEditable)
throw new UserError(`The sales of this ticket can't be modified`);
// Check if ticket has refunds
const ticketRefunds = await models.TicketRefund.find({

View File

@ -79,9 +79,9 @@ module.exports = Self => {
const saleIds = sales.map(sale => sale.id);
// const hasClaimedSales = await models.ClaimBeginning.findOne({where: {saleFk: {inq: saleIds}}});
// if (ticketId != id && hasClaimedSales)
// throw new UserError(`Can't transfer claimed sales`);
const hasClaimedSales = await models.ClaimBeginning.findOne({where: {saleFk: {inq: saleIds}}});
if (ticketId != id && hasClaimedSales)
throw new UserError(`Can't transfer claimed sales`);
for (const sale of sales) {
const originalSale = map.get(sale.id);
@ -101,14 +101,11 @@ module.exports = Self => {
try {
await models.Ticket.setDeleted(ctx, id, myOptions);
} catch (e) {
console.log('e:', e);
console.log('e.message:', e.message);
console.log('e translation:', $t(e.message, {}));
if (e.statusCode === 400) {
throw new UserError(
`This ticket cannot be left empty.`,
'TRANSFER_SET_DELETED',
$t(e.message)
$t(e.message, ...e.translateArgs)
);
}
throw e;
@ -120,7 +117,6 @@ module.exports = Self => {
return {id: ticketId};
} catch (e) {
if (tx) await tx.rollback();
console.log('e.UserError:', e);
throw e;
}
};