« first day (231 days earlier)      last day (403 days later) » 

Anonymous
3:33 AM
@Downgoat I remember now - I did that on purpose. Deleting an answer/post uses the same endpoint as editing. Just pass deleted: True
 
@Mego btw for editing do I need to pass all the fields or only the changed ones?
 
Anonymous
Only the changed ones
 
Anonymous
It's not 1995 :P
 
also is there deleting/editing comments yet?
 
Anonymous
Not yet
 
Anonymous
3:41 AM
Comment stuff is lower priority
 
3:51 AM
I am getting this error:
sqlalchemy.exc.StatementError: (builtins.TypeError) unhashable type: 'list' [SQL: 'UPDATE answers SET deleted=%(deleted)s WHERE answers.id = %(answers_id)s'] [parameters: [{'deleted': ['true'], 'answers_id': 20}]]
when doing POST to /answer/20/edit
with:
------WebKitFormBoundaryykF6BFfMDmKYepzH
Content-Disposition: form-data; name="deleted"

true
------WebKitFormBoundaryykF6BFfMDmKYepzH--
I don't think FormData natively has booleans that could be the issue?
 
@Downgoat isn't the issue that parameter is ['true']
 
Anonymous
Yeah, it should be getting translated as 1
 
Anonymous
Or True, because that's before param translation I think
 
4:11 AM
@ASCII-only yeah but i have no idea why flask is doing that
I am just setting the formData.deleted = true
so it'll do whatever it does on checkboxes etc
doing deleted: deleted ? '1' : '0' i.e. sending 1 doesn't work either
yeah i have no idea why it's interpreted as a list
 
Anonymous
What does the form data look like on the Python side?
 
4:31 AM
how would i check? Flask seems to gobble print()s
 
Anonymous
If you run it directly via CLI, print should still work normally
 
Anonymous
Or just set the answer's code property to a JSON dump of the form :P
 
@Mego I'm doing FLASK_DEBUG=1 FLASK_APP=app/start.py flask run if that's what you mean by CLI
do we want to show golfs e.g. "53 51 bytes"?
alternatively we could just show 103 -> 51 bytes and hide intermediate golfs
 
Anonymous
Neither - just display them in the edit history
 
Anonymous
@Downgoat No, do FLASK_DEBUG=1 ./run.py
 
4:41 AM
ImmutableMultiDict([('deleted', 'True')])
@Mego couldn't a malicious user pass a user_id: something into the /edit endpoint and change the owner of a post?
also there doesn't seem to be any verification on who is editing a post
 
Anonymous
@Downgoat Yeah, that needs to be locked down
 
Anonymous
@Downgoat I wrote the controller hastily :P
 
Anonymous
I'll fix the security issues in a bit in the controller
 
Anonymous
@Downgoat I should probably change it to use JSON objects instead of form data :/
 
json is pretty great
kinda surprised flask doesn't have an API to abstract between form/json depending on body mime-type
@quartata run button is being thrown away and will be replaced with test suite features so just pretend it doesnt exist :P
 
Anonymous
4:51 AM
@Downgoat There's probably an extension for that
 
5:25 AM
could you ping me when fixed
 
Anonymous
Yeah, will probably be tomorrow as I'm about to go to bed
 
8:11 AM
@Mego @Downgoat IMO that should be optional at least - it allows users to quickly estimate challenge difficulty (or maybe user skill)
 

« first day (231 days earlier)      last day (403 days later) »