I reviewed the code and it turns out suspended?
is simply defined as suspended_till && suspended_till > DateTime.now
.
A user could be returned as not suspended
if the period of time simply expired. suspnded_at
in that case would still have a value because they were suspended then. I don’t think this is strictly a bug, as suspended
would still be correct.
I did make two changes to make the API less confusing though:
-
suspended
will always betrue
orfalse
, you don’t have to worry aboutnull
anymore. -
suspended_at
andsuspended_till
will not be returned unlesssuspended
is true. This shrinks our JSON payload which is nice.
https://github.com/discourse/discourse/commit/f73a3cc0d4b9d7e8c1fbf2a4309397074ce4ec02