Files
edx-platform/lms/static/js/certificates/models/certificate_invalidation.js
Syed Ali Abbas Zaidi f1fb38ed83 fix: multi lines and spaces issues (#31885)
* fix: multi lines and spaces issues

* fix: eslint operator-linebreak issue

* fix: eslint quotes issue

* fix: remaining quotes issues

* fix: eslint object curly newline issue

* fix: eslint object curly spacing issue

* fix: eslint brace-style issues

* fix: react jsx indent and props issues

* fix: eslint trailing spaces issues

* fix: eslint linbreak style issue

* fix: eslint space unary operator issue

* fix: eslint line around directives issue

* fix: void and typeof space unary ops issue
2023-05-03 12:22:46 +05:00

36 lines
1.1 KiB
JavaScript

// Backbone.js Application Model: CertificateInvalidation
/* global define, RequireJS */
(function(define) {
'use strict';
define(
['underscore', 'underscore.string', 'gettext', 'backbone'],
function(_, str, gettext, Backbone) {
return Backbone.Model.extend({
idAttribute: 'id',
defaults: {
user: '',
invalidated_by: '',
created: '',
notes: ''
},
initialize: function(attributes, options) {
this.url = options.url;
},
validate: function(attrs) {
if (!str.trim(attrs.user)) {
// A username or email must be provided for certificate invalidation
return gettext('Student username/email field is required and can not be empty. '
+ 'Kindly fill in username/email and then press "Invalidate Certificate" button.');
}
}
});
}
);
}).call(this, define || RequireJS.define);