ErwinKomen / RU-passim

0 stars 0 forks source link

DCT: process ShowDCT gets stuck #756

Closed ErwinKomen closed 2 months ago

ErwinKomen commented 2 months ago

User created a ResearchSet, then pressed Show DCT, and that process appears to keep on 'running'

ErwinKomen commented 2 months ago

Investigation

The log file says:

order_heads = [{"name": "Historical Collection", "order": "o=1", "type": "str", "field": "name", "linkdetails": true, "used": null, "sorting": "1", "direction": "", ">order_default = ["name", "", "", "ssgauthornum", "created"]
Error: basic/view/make_ordering
System:list index out of range at line 605
passimcode
signature
signature

Okay, the error above comes from seeker / views CollectionListView, when the prefix ishist. In that case the field **Added** has been removed, but the line withorder_cols` was not adapted.

After adapting that field, no problem

ErwinKomen commented 2 months ago

The problem

The problem is that a non-editor is not allowed to make a DCT. User gegr-user is not an editor.

Solution

For now I added an error message when 'creating' a DCT

ErwinKomen commented 2 months ago

P.I. says:

... alle gebruikers moeten de DCT functionaliteit kunnen gebruiken, ook niet-editors mogen dus DCTs maken.

ErwinKomen commented 2 months ago

Implementation

  1. Adapt dct_view.html again, so that there is no difference between editors and non-editors for the DCT-tool - done
  2. Adapt dct/views.py SetDefDetails: no problem there
  3. Adapt dct/views.py SetDefData:
    1. Added own version of userpermissions() to allow downloading
    2. Updated basic's BasicPart downloading to use base64.decodebytes() (since the previous function has been depracated)
  4. Tricky thing in basic.js, post_download(), case hist-png, showing dropdown-menu must go like this:
 $(frm).find(".dropdown-menu").toggleClass('open');