FIX: suspended users still appear suspended after their suspension expires

This commit is contained in:
Neil Lalonde 2013-12-03 15:53:30 -05:00
parent c4394688de
commit 915861a646
2 changed files with 4 additions and 5 deletions

View File

@ -99,6 +99,10 @@ Discourse.User = Discourse.Model.extend({
isSuspended: Em.computed.equal('suspended', true),
suspended: function() {
return this.get('suspended_till') && moment(this.get('suspended_till')).isAfter();
}.property('suspended_till'),
suspendedTillDate: function() {
return Discourse.Formatter.longDate(this.get('suspended_till'));
}.property('suspended_till'),

View File

@ -18,7 +18,6 @@ class UserSerializer < BasicUserSerializer
:moderator,
:admin,
:title,
:suspended,
:suspend_reason,
:suspended_till
@ -99,10 +98,6 @@ class UserSerializer < BasicUserSerializer
SiteSetting.enable_names?
end
def suspended
object.suspended?
end
def include_suspended?
object.suspended?
end