BibIndex: bibauthorid performance improvements

* Re-implements get_author_canonical_ids_for_recid() to bypass
  complex BibAuthorID API usage and directly retrieve data
  from the DB for a gain of speed of ~800x.

* Fixes bug introduced in previous re-implementation of
  get_author_canonical_ids_for_recid() where the flag column
  was not considered.

Signed-off-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Co-authored-by: Samuele Carli <samuele.carli@cern.ch>
Co-authored-by: Alessio Deiana <alessio.deiana@cern.ch>
Reported-by: Annette Holtkamp <annette.holtkamp@cern.ch>
BibAuthorID: Fixed bibref selection dropdown bug in claiming system.
BibAuthorID: fixed name resolution problem

* Clicking on a name on a paper now brings correctly to the author page
  instead of a person search page. Solves some minor ambiguity problems.
BibAuthorID: fix crash on /manage_profile without args

* Now /author/manage_profile/ correctly displays an error message
  when visited without the expected argument.

Signed-off-by: Samuele Carli <samuele.carli@cern.ch>
Reviewed-by: Samuele Kaplun <samuele.kaplun@cern.ch>
BibAuthorID: fix wrong string replacement in assertion

* The assertion message was generating an exception due to a bad
  string replacement.

Signed-off-by: Carli Samuele <samuele.carli@cern.ch>
BibAuthorID: fix in import_publication_from_orcid

* The system crashed in case something goes wrong and the
  orcid was not assignet to a profile yet when the import
  was called. Now this is handled gracefully.

Signed-off-by: Carli Samuele <samuele.carli@cern.ch>
crossrefutils: handle UnboundLocalError

* Fixes UnboundLocalError when number of server retries reach
  it's maximum and the code is trying to call a variable that
  is not defined.

* Fixes a few PEP8 issues.

Signed-off-by: Jan Aage Lavik <jan.age.lavik@cern.ch>
BibAuthorID: exception when merging profiles

* Fixes a bug when setting the primary profile. The merge_primary_profile
  was initizialized properly.

Reviewed-by: Petros Ioannidis <petros.ioannidis@cern.ch>
BibAuthorID: change hepnames js source

* Changes captcha JS source to https

Signed-off-by: Javier Martin Montull <javier.martin.montull@cern.ch>
BibAuthorID: get_papers_affected_since() timestamp

* Fixes get_papers_affected_since() to consider timestamps
  in an inclusive manner.

Signed-off-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Reviewed-by: Samuele Carli <samuele.carli@cern.ch>
BibAuthorID: affiliations bookkeeping

* Adds a step in rabbit to keep a list of mappings pid -> affiliations.

Signed-off-by: Alessio Deiana <alessio.deiana@cern.ch>
Signed-off-by: Samuele Carli <samuele.carli@cern.ch>
Bibauthorid: Fix for name decoding in affiliations daemon.
BibAuthorID: handling inconsistent data in affiliations
BibAuthorID: error handling in affiliations engine

* The process does not crash anymore in case of inconsistent
data, but proceeds gracefully.

Reviewed-by: Javier Martin Montull <javier.martin.montull@cern.ch>
BibAuthorID: more error handling in affiliations

* Gracefully continue in case of data corruption
installation: jquery plugins
BibAuthorID: amends tests
inveniocfg: affiliations in atlantis

* Computes affiliations during inveniocfg --load-demo-records
BibAuthorID: fixes for affiliations

Signed-off-by: Alessio Deiana <alessio.deiana@cern.ch>
installation: more fixes to load demo records