fixed duplicated pictos (now it is possible)

parent b5d0af59
......@@ -883,16 +883,7 @@ module.exports = {
add_picto: function (req, res) {
var params = req.allParams();
StuPicto.find({id_pic: params.id_picto, id_stu: params.id_stu})
.then((entries) => {
if (entries && entries.length > 0) {
var err = new Error("Picto already in student's vocabulary");
err.code = sails.config.pictogram.error_codes.DUPLICATED_PICTO;
throw err;
}
return Student.findOne({ id: params.id_stu });
})
Student.findOne({ id: params.id_stu })
.then((student) => {
if (!student) {
sails.log.error(`Student ${params.id_stu} not found`);
......
......@@ -49,7 +49,7 @@
</div>
<div class="form-group">
<label translate>license_number</label>
<input type="text" id="setup_license" class="form-control" mask="9999-9999-9999-9999" clean="true" placeholder="{{ 'license_number' | translate }}" ng-model="formUser.license_number" required>
<input type="text" id="setup_license" class="form-control" mask="wwww-wwww-wwww-wwww" clean="true" placeholder="{{ 'license_number' | translate }}" ng-model="formUser.license_number" required>
<div ng-show="studentData.license && !studentData.license_expired" class="alert alert-info" role="alert">
<i class="fa fa-info-circle" aria-hidden="true"></i> {{ 'license_expires' | translate }} {{ studentData.expiration_date }}
......
......@@ -26,7 +26,7 @@
</div>
<div class="form-group">
<input class="form-control" type="text" id="student_license" mask="9999-9999-9999-9999" clean="true" placeholder="{{ 'license_number' | translate }}" ng-model="formdatastudent.license_number" required>
<input class="form-control" type="text" id="student_license" mask="wwww-wwww-wwww-wwww" clean="true" placeholder="{{ 'license_number' | translate }}" ng-model="formdatastudent.license_number" required>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment