pablobm left a comment (openstreetmap/openstreetmap-website#6564)
There's a problem with allowing `confirmed` users to transition to `suspended`.
Currently, there's an `User.after_save :spam_check`. This in turn looks like
follows:
https://github.com/openstreetmap/openstreetmap-website/blob/398660d1fa0007c9a0e65d26fb6b4a8e4a422da8/app/models/user.rb#L404-L406
So we enter this problem:
1. A legit user is suspended automatically by the spam check (a false positive).
2. An admin confirms the user to reactivate them and protect them from future
spam checks.
3. As the user is confirmed, they are saved... and immediately suspended again
as the spam check returns a new false positive.
Ways around this issue:
1. We add an additional `&& !confirmed?` to the spam check condition, so that
it specifically doesn't trigger on confirmed users. They can still be
suspended/unconfirmed manually.
2. We return to disallowing the transition `confirmed -> suspended`.
3. We change the logic completely.
4. Other?
I'm going to go for option 1, but please let me know if you think differently.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6564#issuecomment-3626490342
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/6564/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev