Merge branch 'master' of https://github.com/ksjdragon/hourglass
This commit is contained in:
commit
0bcec1bfd6
@ -444,6 +444,7 @@ Meteor.methods({
|
|||||||
|
|
||||||
// User Functions
|
// User Functions
|
||||||
'editProfile': function(change) {
|
'editProfile': function(change) {
|
||||||
|
var refyear = new Date().getUTCFullYear();
|
||||||
var current = Meteor.user().profile;
|
var current = Meteor.user().profile;
|
||||||
current = {
|
current = {
|
||||||
"__proto__": current.__proto__,
|
"__proto__": current.__proto__,
|
||||||
@ -458,6 +459,9 @@ Meteor.methods({
|
|||||||
if (current.description && current.description.length > 50) {
|
if (current.description && current.description.length > 50) {
|
||||||
current.description = current.description.slice(0, 50);
|
current.description = current.description.slice(0, 50);
|
||||||
}
|
}
|
||||||
|
if (current.grade <= refyear || current.grade >= refyear + 4) {
|
||||||
|
current.grade = refyear;
|
||||||
|
}
|
||||||
Meteor.users.update({
|
Meteor.users.update({
|
||||||
_id: Meteor.userId()
|
_id: Meteor.userId()
|
||||||
}, {
|
}, {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user