Fix remove user from cert-exception list

ECOM-4650
This commit is contained in:
Awais Jibran
2016-06-09 15:24:33 +05:00
parent 1e67ec66cd
commit 8d40dcd0f4
4 changed files with 42 additions and 12 deletions

View File

@@ -24,11 +24,9 @@
certificate_generated: '',
notes: ''
},
url: function() {
return this.get('url');
initialize: function (attributes, options) {
this.url = options.url;
},
validate: function(attrs){
if (!str.trim(attrs.user_name) && !str.trim(attrs.user_email)) {
return gettext('Student username/email field is required and can not be empty. ' +

View File

@@ -44,13 +44,17 @@
model = {user_name: user_name};
}
var certificate_exception = new CertificateExceptionModel({
url: this.collection.url,
user_name: user_name,
user_email: user_email,
notes: notes,
new: true
});
var certificate_exception = new CertificateExceptionModel(
{
user_name: user_name,
user_email: user_email,
notes: notes,
new: true
},
{
url: this.collection.url
}
);
var message = "";
if(this.collection.findWhere(model)){

View File

@@ -30,7 +30,7 @@ define([
beforeEach(function() {
certificate_exception = new CertificateExceptionModel({user_name: 'test_user'});
certificate_exception = new CertificateExceptionModel({user_name: 'test_user'}, {url: 'test/url/'});
certificate_exception.set({
notes: "Test notes"
});