Default owner for new event triggers.

This commit is contained in:
Dave Page
2016-03-11 16:58:46 +00:00
parent b6f7202448
commit fd05dec29c
@@ -92,6 +92,19 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
source: undefined,
language: undefined
},
// Default values!
initialize: function(attrs, args) {
var isNew = (_.size(attrs) === 0);
if (isNew) {
var userInfo = pgBrowser.serverInfo[args.node_info.server._id].user;
this.set({'eventowner': userInfo.name}, {silent: true});
}
pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments);
},
// Define the schema for the event trigger node
schema: [{
id: 'name', label: '{{ _('Name') }}', cell: 'string',