diff --git a/cms/static/js/certificates/models/signatory.js b/cms/static/js/certificates/models/signatory.js index 6644d01b51..d16bdaaa4e 100644 --- a/cms/static/js/certificates/models/signatory.js +++ b/cms/static/js/certificates/models/signatory.js @@ -33,11 +33,6 @@ function(_, str, Backbone, BackboneRelational, gettext) { validate: function(attrs) { var errors = null; - if(_.has(attrs, 'name') && attrs.name.length > 40) { - errors = _.extend({ - 'name': gettext('Signatory name should not be more than 40 characters long.') - }, errors); - } if(_.has(attrs, 'title')){ var title = attrs.title; var lines = title.split(/\r\n|\r|\n/); @@ -46,13 +41,6 @@ function(_, str, Backbone, BackboneRelational, gettext) { 'title': gettext('Signatory title should span over maximum of 2 lines.') }, errors); } - else if ((lines.length > 1 && (lines[0].length > 53 && lines[1].length > 53)) || - (lines.length === 1 && title.length > 106)) { - errors = _.extend({ - 'title': gettext('Signatory title should have maximum of 40 characters per line.') - }, errors); - } - } if (errors !== null){ return errors; diff --git a/cms/static/js/certificates/spec/views/certificate_details_spec.js b/cms/static/js/certificates/spec/views/certificate_details_spec.js index 3314348bcd..a03748f9f4 100644 --- a/cms/static/js/certificates/spec/views/certificate_details_spec.js +++ b/cms/static/js/certificates/spec/views/certificate_details_spec.js @@ -252,7 +252,7 @@ function(_, Course, CertificatesCollection, CertificateModel, CertificateDetails }); setValuesToInputs(this.view, { - inputSignatoryTitle: 'This is a certificate signatory title that has waaaaaaay more than 106 characters, in order to cause an exception.' + inputSignatoryTitle: 'Signatory Title \non three \nlines' }); setValuesToInputs(this.view, { diff --git a/cms/static/js/certificates/spec/views/certificate_editor_spec.js b/cms/static/js/certificates/spec/views/certificate_editor_spec.js index 9ea6dbd241..1d2cd14790 100644 --- a/cms/static/js/certificates/spec/views/certificate_editor_spec.js +++ b/cms/static/js/certificates/spec/views/certificate_editor_spec.js @@ -228,10 +228,10 @@ function(_, Course, CertificateModel, SignatoryModel, CertificatesCollection, Ce } ); - it('signatories should not save when fields have too many characters per line', function() { + it('signatories should save when fields have too many characters per line', function() { this.view.$(SELECTORS.addSignatoryButton).click(); setValuesToInputs(this.view, { - inputCertificateName: 'New Certificate Name' + inputCertificateName: 'New Certificate Name that has too many characters without any limit' }); setValuesToInputs(this.view, { @@ -243,7 +243,7 @@ function(_, Course, CertificateModel, SignatoryModel, CertificatesCollection, Ce }); this.view.$(SELECTORS.saveCertificateButton).click(); - expect(this.view.$('.certificate-edit-error')).toHaveClass('is-shown'); + expect(this.view.$('.certificate-edit-error')).not.toHaveClass('is-shown'); }); it('signatories should not save when title span on more than 2 lines', function() { diff --git a/cms/templates/js/signatory-editor.underscore b/cms/templates/js/signatory-editor.underscore index 65789a9eb5..cea8ea7c8c 100644 --- a/cms/templates/js/signatory-editor.underscore +++ b/cms/templates/js/signatory-editor.underscore @@ -11,16 +11,16 @@