Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

portrait traverser error #68

Open
kingel opened this issue May 6, 2019 · 1 comment
Open

portrait traverser error #68

kingel opened this issue May 6, 2019 · 1 comment

Comments

@kingel
Copy link

kingel commented May 6, 2019

I added portrait to the User Property-Sheet Attributes

Name on Sheet | LDAP Attribute
portrait | jpegPhoto

but when I view the user author page I get this error:

File "/Users/kingel/Projects/melexis/eggs/pas.plugins.ldap-1.5.3-py2.7.egg/pas/plugins/ldap/monkey.py", line 56, in traverse
    return getPortraitFromSheet(self.context, userid).__of__(self.context)
TypeError: attempt to wrap extension method using an object that is not an extension class instance.
ipdb> self.context
<Products.Five.metaclass.SimpleViewClass from /Users/kingel/Projects/melexis/eggs/Products.CMFPlone-5.1.5-py2.7.egg/Products/CMFPlone/browser/templates/author.pt object at 0x10ef9d2d0>

In the debugger I wrote the raw data to a jpeg and was able to view it.

Searching for the error doesn't yield useful results.

And now I am stuck here, did anyone work with portraits from ldap before? Did you also encounter this problems?

@kingel kingel pinned this issue May 6, 2019
@kingel kingel unpinned this issue May 6, 2019
@kingel
Copy link
Author

kingel commented May 6, 2019

Apparently it has to do with calling it on that view, I have overriden the author template

 <img src=""
         alt="User portrait picture"
         i18n:attributes="alt"
         class="userinfo__image"
         tal:attributes="src python:'%s/%s' % (portal_url, portrait.absolute_url())" />

and like this it does work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant