OpenRA / OpenRA-Resources

The OpenRA Resource Center helps the community sharing their custom maps.
http://resource.openra.net
Other
21 stars 18 forks source link

Map is still showing in "Show only with reports" filter when report is filed and then canceled #306

Closed netnazgul closed 6 years ago

netnazgul commented 6 years ago

My python knowledge is quite limited (i.e. haven't ever seen python code before), but supposedly I'm onto something here:

This is the POST for map report which creates new Report object, pushes that reports container and increments map's "amount_reports" value https://github.com/OpenRA/OpenRA-Resources/blob/a3c053b46e0ec99a7a40bf5adb40565b71f0c8e9/openra/views.py#L401-L420

This is the "cancelReport" action which removes the Report object specified. Note, however, that "amount_reports" is not decremented. https://github.com/OpenRA/OpenRA-Resources/blob/a3c053b46e0ec99a7a40bf5adb40565b71f0c8e9/openra/views.py#L1011-L1015

"Only show with reports" filter uses the "amount_reports" field here https://github.com/OpenRA/OpenRA-Resources/blob/db42f5b617a3a1d6729676aeb6a83a2031dea9f0/openra/misc.py#L406-L408