Check for '_from' presence to detect complex link vs text
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 13 Jun 2017 12:00:37 +0200
changeset 2644 70aa0aea82ee
parent 2643 50fc4ed12eae
child 2645 0d8167d5a77e
Check for '_from' presence to detect complex link vs text instead of hard-coded 'language'. We should also match seda_originating_agency_from. This heuristic is already used in e.g. `rtags_from_rtype_role_targets` function. Closes #17084054
cubicweb_seda/views/archiveunit.py
--- a/cubicweb_seda/views/archiveunit.py	Tue Jun 06 11:27:41 2017 +0200
+++ b/cubicweb_seda/views/archiveunit.py	Tue Jun 13 12:00:37 2017 +0200
@@ -915,7 +915,7 @@
         novalue_label = _('<no value specified>')
     else:
         novalue_label = ' '
-    vid = 'seda.reledit.complexlink' if 'language' in rtype else 'seda.reledit.text'
+    vid = 'seda.reledit.complexlink' if rtype.endswith('_from') else 'seda.reledit.text'
     if role == 'subject':
         rec.tag_subject_of((CONTENT_ETYPE, rtype, '*'),
                            {'rvid': vid, 'novalue_label': novalue_label})