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:
-
suspendedwill always betrueorfalse, you don’t have to worry aboutnullanymore. -
suspended_atandsuspended_tillwill not be returned unlesssuspendedis true. This shrinks our JSON payload which is nice.
https://github.com/discourse/discourse/commit/f73a3cc0d4b9d7e8c1fbf2a4309397074ce4ec02