openstreetmap / openstreetmap-website

The Rails application that powers OpenStreetMap
https://www.openstreetmap.org/
GNU General Public License v2.0
2.21k stars 918 forks source link

Don't update deactivates_at if block was already viewed #5312

Closed AntonKhorev closed 1 week ago

AntonKhorev commented 1 week ago

When a blocked user visits their block page, its deactivation time is recorded. Problem is this only needs to happen if there's no deactivation time set. If it's already set, it should be kept at what it is.

The possible bug is that if the user visits their block page after the block is lifted, that visit time gets into deactivates_at and is reported as the block end time despite the block ending earlier.