Files
edx-platform/lms/static/js/certificates/models/certificate_exception.js
Justin Hynes 205911653b refactor: Rename "whitelist" references to "allowlist" where possible in Instructor Dashboard/Certificates apps
[MICROBA-1179]
- Continue renaming/removal of code referring to the Certificate "white list".

The Certificates Django app `CertificateWhitelist` model is going away in an effort to make our codebase more inclusive. It is being replaced
with the `CertificateAllowlist` model. This PR continues to replace references to the Certificate "whitelist" with "allowlist" wherever
possible. There should be no change in functionality, nor are there any changes in appearance.
2021-06-22 08:18:15 -04:00

39 lines
1.2 KiB
JavaScript

// Backbone.js Application Model: CertificateAllowlist
/* global define, RequireJS */
(function(define) {
'use strict';
define([
'underscore',
'underscore.string',
'backbone',
'gettext'
],
function(_, str, Backbone, gettext) {
return Backbone.Model.extend({
idAttribute: 'id',
defaults: {
user_id: '',
user_name: '',
user_email: '',
created: '',
certificate_generated: '',
notes: ''
},
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. ' +
'Kindly fill in username/email and then press "Add to Exception List" button.');
}
}
});
}
);
}).call(this, define || RequireJS.define);