From 915861a646f1904c54035acefa8c4f20f116f46f Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 3 Dec 2013 15:53:30 -0500 Subject: [PATCH] FIX: suspended users still appear suspended after their suspension expires --- app/assets/javascripts/discourse/models/user.js | 4 ++++ app/serializers/user_serializer.rb | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/models/user.js b/app/assets/javascripts/discourse/models/user.js index 6316e4f7883..7fa3df262a1 100644 --- a/app/assets/javascripts/discourse/models/user.js +++ b/app/assets/javascripts/discourse/models/user.js @@ -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'), diff --git a/app/serializers/user_serializer.rb b/app/serializers/user_serializer.rb index 38be5f60614..5af590cb167 100644 --- a/app/serializers/user_serializer.rb +++ b/app/serializers/user_serializer.rb @@ -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