Closed ghost closed 5 years ago
do you want it to be possible? does it make sense?
edit: my bad, i read that as a question.
the backend throws an error and the empty RIPE handle is dismissed. thats a valid behaviour i'd say
I get an error "Bad gateway" when clicking on "Add RIPE handle" when the text box is empty.
The same behavior for empty, invalid and already used RIPE handles. This is just about better error handling.
das passiert wenn man ein leeres handle schicken will
root@cp-backend-aec-stg:~# tail -f /var/log/uwsgi/app/doportal.log
File "./app/cp/organizations.py", line 445, in update_cp_organization
o.from_json(request.json)
File "./app/models.py", line 143, in from_json
setattr(self, attr, value)
File "./app/models.py", line 995, in ripe_handles
forg_x_org.ripe_org_hdl = ripe_handle
File "./app/models.py", line 724, in ripe_org_hdl
fody_org = FodyOrganization(ripe_org_hdl = ripe_org_hdl)
File "./app/fody_models.py", line 42, in __init__
raise AttributeError('no such handle')
AttributeError: no such handle
[pid: 23247|app: 0|req: 4/13] 83.136.38.239 () {56 vars in 1308 bytes} [Thu Nov 8 10:18:48 2018] PUT /cp/1.0/organizations/28 => generated 0 bytes in 307 msecs (HTTP/1.0 500) 0 headers in 0 bytes (0 switches on core 1)
Submitting an existing RIPE handle sometimes shows a "Bad Gateway" error and sometime a (correct) "this RIPE handle already exists." error
if you add a RIPE handle the following happens on the frontend
1) add ripe handle to js array (handle is displayed immediately) 2) send to backend 3) on error, delete from frontend
if you click too fast the handle still exists on the frontend and a "already ecists" notification is shown
in commit 0d23b866eb64d64faaba7aaf459a5cc3a49a1b48
always sends {.... "ripe_handles":[null]} on update
update with nonexisting ripe handle returns 404 now curl 'http://127.0.0.1:8000/cp/1.0/organizations/4' -X PUT -H 'Origin: http://127.0.0.1:5002' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.9,de;q=0.8,es;q=0.7' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, /' -H 'Referer: http://127.0.0.1:5002/' -H 'Cookie: rm=1|ba943e7bd05004f3d501e5dff6741fc1a30a10118cfc128d50d5916d3a01b6d246e2ff374ed0f63d1db127c6bdbaadca3ea24148b3329b79cf99770fc278a72d; username=cert%40master.at' -H 'Connection: keep-alive' -H 'DNT: 1' --data-binary '{"abbreviation":"eorg-gas","abuse_emails":[],"asns":[],"display_name":"eorg-gas","fqdns":[],"full_name":"eorg-gas updated4","id":4,"ip_ranges":[],"is_sla":true,"mail_template":"EnglishReport","mail_times":3600,"parent_org_abbreviation":"eorg","parent_org_id":2,"ripe_handles":["bla"]}' --compressed {"message": "no such handle"}
?
cant find that commit and dont know why you assigned me.
the frontend always sends "ripe_handles":[null] and not "ripe_handles":[] which would be correct
It is possible to submit "empty" ripe handles