CottageLabs / idfind

An identifier identifier
1 stars 0 forks source link

Submission page not working #2

Closed emanuil-tolev closed 12 years ago

emanuil-tolev commented 12 years ago

Submission page displays, but:

  1. Changing the value of the radio button labeled "Do you want to submit a test or description?" doesn't dynamically update the form as expected (less fields for the "A description of a type of identifier" option).
  2. Upon submission page reverts to blank form and tells user they have not specified whether they want to submit test or description, exact msg: "You did not tell us if you are submitting a test or a description". Doesn't work when either one of the test/description radio buttons is selected.

Plus, it REALLY does not index the data the user submitted (no new items in elasticsearch index).

emanuil-tolev commented 12 years ago

Reason found: during prettification of submission form, radio button input element's name changed from 'type' to 'test_or_desc' in the template, but nowhere in the code which processes the template, so no surprises there. Working to resolve in master.

emanuil-tolev commented 12 years ago

Furthermore: more fields added to submission page, no code to handle them. Working to resolve in master.

Furthermore: url_prefix field is modified by the code in importer.py before it's indexed into ES. Modification is a bit flaky though - if the field is left blank, it ends up being "http:///" in the index. Also, judging from dao.py (and bibserver's dao.py), if data needs processing before indexing into ES, a method should be defined in the dao.py class definition for that class. Class Test needs new method in this case. See dao.py:Account's methods for an example of where I got that notion from. So, perhaps url_prefix will benefit from a method in dao.py:Test. NOT working on this right now, just noting.

emanuil-tolev commented 12 years ago

Okay, url_prefix handling code actually OVERWRITES whatever the user puts in with http:///. Not going to re-architecture it right now, but working on fix in master.

emanuil-tolev commented 12 years ago

Recap:

  1. Request element 'type' no longer existed due to being renamed to 'test_or_desc'. All relevant code that processed that bit of the request should be OK now.
  2. "Success response"-related fields on the Test / Description submission page were not being processed by code at all. They are now.
  3. The url_prefix field: 3.1. was being overwritten with the contents of url_suffix instead. This is fixed. 3.2. I noted above that code which processes data before indexing into ES may need to be moved to the relevant dao.py class. I don't think this is applicable to url_prefix though. Code which processes data and may need to be run more than once from different parts of the program merits its own method (e.g. checking for passwords in the Account example I gave in the comment above), but not one-off data processing. So I haven't moved the url_prefix handling code from importer.py and I no longer think it should be moved.