[web/views/rdf] Take the second element of XY equivalent for non final relation
When given a Yams snippet of the form `<etype> <rtype>` ``xy.xeq()`` will
return the XML snippet equivalent to this relation in the form of a tuple
`(subject, rtype, object)` so ``item`` will always be a tuple here.
In fact, the correct code appears just a few lines above (around line 88) for
final relations so I guess this is a copy-paste mistake.
Closes #4745929.
frombase64importb64decode,b64encodetry:uri,newdn=__args__exceptValueError:print'USAGE: cubicweb-ctl shell <instance> ldap_change_base_dn.py -- <ldap source uri> <new dn>'printprint'you should not have updated your sources file yet'olddn=repo.sources_by_uri[uri].config['user-base-dn']assertolddn!=newdnraw_input("Ensure you've stopped the instance, type enter when done.")foreid,extidinsql("SELECT eid, extid FROM entities WHERE source='%s'"%uri):olduserdn=b64decode(extid)newuserdn=olduserdn.replace(olddn,newdn)ifnewuserdn!=olduserdn:printolduserdn,'->',newuserdnsql("UPDATE entities SET extid='%s' WHERE eid=%s"%(b64encode(newuserdn),eid))commit()print'you can now update the sources file to the new dn and restart the instance'