Fixed violates check constraint issue when creating a pgAgent schedule. #7390

This commit is contained in:
Akshay Joshi 2024-04-23 17:27:11 +05:30
parent 673b5ea5a1
commit 9f6ddd3cf9
4 changed files with 9 additions and 6 deletions

View File

@ -37,4 +37,5 @@ Bug fixes
| `Issue #7282 <https://github.com/pgadmin-org/pgadmin4/issues/7282>`_ - Fixed an XSS vulnerability in the /settings/store endpoint.
| `Issue #7294 <https://github.com/pgadmin-org/pgadmin4/issues/7294>`_ - Fixed an issue where double dollar quoted code is treated as string in syntax highlighter.
| `Issue #7317 <https://github.com/pgadmin-org/pgadmin4/issues/7317>`_ - Fixed an issue where pressing backspace should remove the spaces and not the entire tab width, on enabling 'Use spaces?' in the preferences.
| `Issue #7384 <https://github.com/pgadmin-org/pgadmin4/issues/7384>`_ - Fixed an issue when closing the view data second tab; it raises the error that the 'ViewCommand' object has no attribute 'auto_commit'.
| `Issue #7384 <https://github.com/pgadmin-org/pgadmin4/issues/7384>`_ - Fixed an issue when closing the view data second tab; it raises the error that the 'ViewCommand' object has no attribute 'auto_commit'.
| `Issue #7390 <https://github.com/pgadmin-org/pgadmin4/issues/7390>`_ - Fixed violates check constraint issue when creating a pgAgent schedule.

View File

@ -682,7 +682,7 @@ It may have been removed by another user.
if k in ('comment',):
data[k] = v
else:
data[k] = json.loads(v, encoding='utf-8')
data[k] = json.loads(v)
except (ValueError, TypeError, KeyError):
data[k] = v

View File

@ -13,6 +13,8 @@ import { isEmptyString } from 'sources/validators';
import moment from 'moment';
import { WEEKDAYS, MONTHDAYS, MONTHS, HOURS, MINUTES } from '../../../../../../static/js/constants';
const PGAGENT_MONTHDAYS = [...MONTHDAYS].concat([{label: gettext('Last day'), value: 'Last Day'}]);
export class ExceptionsSchema extends BaseUISchema {
constructor(fieldOptions={}, initValues={}) {
super({
@ -126,7 +128,7 @@ export class DaysSchema extends BaseUISchema {
placeholder: gettext('Select the month days...'),
formatter: BooleanArrayFormatter,
},
options: MONTHDAYS,
options: PGAGENT_MONTHDAYS,
}, {
id: 'jscmonths', label: gettext('Months'), type: 'select',
group: gettext('Days'),
@ -185,7 +187,7 @@ export default class PgaJobScheduleSchema extends BaseUISchema {
jscstart: null,
jscend: null,
jscweekdays: _.map(WEEKDAYS, function() { return false; }),
jscmonthdays: _.map(MONTHDAYS, function() { return false; }),
jscmonthdays: _.map(PGAGENT_MONTHDAYS, function() { return false; }),
jscmonths: _.map(MONTHS, function() { return false; }),
jschours: _.map(HOURS, function() { return false; }),
jscminutes: _.map(MINUTES, function() { return false; }),
@ -274,7 +276,7 @@ export default class PgaJobScheduleSchema extends BaseUISchema {
controlProps: {
formatter: {
fromRaw: (backendVal)=> {
return obj.customFromRaw(backendVal, MONTHDAYS);
return obj.customFromRaw(backendVal, PGAGENT_MONTHDAYS);
}
},
}

View File

@ -524,7 +524,7 @@ SELECT EXISTS(
sql = ''
for k, v in request.args.items():
try:
data[k] = json.loads(v, 'utf-8')
data[k] = json.loads(v)
except ValueError:
data[k] = v