beyond-all-reason / teiserver

Middleware server for online gaming
https://www.beyondallreason.info/
MIT License
57 stars 53 forks source link

Render the section to edit user stats #252

Closed geekingfrog closed 4 months ago

geekingfrog commented 6 months ago

Nothing was actually being rendered because of a typo. Now we have this bit: 2024-04-12-616x169-scrot

jauggy commented 6 months ago

I tested with key player_minutes and value 999 and it goes to error page.

ArithmeticError at GET /teiserver/admin/user/44
bad argument in arithmetic expression
geekingfrog commented 6 months ago

Alright, I know why. Because through this interface, the only thing that goes through are string values. However the underlying database field is jsonb. That means this interface in this form isn't that useful since we cannot set anything but string values.

One quick fix, if not very ergonomic is to let people input arbitrary json values in this field, and the server then parse it before updating the record.

Beherith commented 6 months ago

Alright, I know why. Because through this interface, the only thing that goes through are string values. However the underlying database field is jsonb. That means this interface in this form isn't that useful since we cannot set anything but string values.

One quick fix, if not very ergonomic is to let people input arbitrary json values in this field, and the server then parse it before updating the record.

Indeed, the key-value thing is strings only!