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

TypeError at /admin/post_office/email/add/ #193

Closed
kakulukia opened this issue Jun 16, 2017 · 8 comments
Closed

TypeError at /admin/post_office/email/add/ #193

kakulukia opened this issue Jun 16, 2017 · 8 comments

Comments

@kakulukia
Copy link
Contributor

/site-packages/post_office/admin.py in _format_value, line 38
'NoneType' object is not iterable

return ','.join([item for item in value]) 

I clicked on the add mail button inside the admin.
Django 1.11.2
Python 3.6.1
PostOffice 2.0.8

@selwin
Copy link
Collaborator

selwin commented Jul 29, 2017

Could you please upgrade to the latest PyPI version (3.0.2) and see if this is still an issue?

@kakulukia
Copy link
Contributor Author

shall i actually be able to create an email by hand? i think its totally okay to just remove the add button in the admin .. i could create a pull request for this easily

@selwin
Copy link
Collaborator

selwin commented Jul 30, 2017 via email

@selwin selwin closed this as completed in e2c7807 Jul 31, 2017
selwin added a commit that referenced this issue Jul 31, 2017
Fix #193 TypeError at /admin/post_office/email/add/
@kakulukia
Copy link
Contributor Author

kakulukia commented Jul 31, 2017

Sorry, but the issue is still existing in 3.0.2:

/Users/andy/.virtualenvs/VFK_PORTAL-9ZY_FLJr/lib/python3.6/site-packages/post_office/admin.py in _format_value

super(CommaSeparatedEmailWidget, self).__init__(*args, **kwargs)
self.attrs.update({'class': 'vTextField'})
def _format_value(self, value):
    # If the value is a string wrap it in a list so it does not get sliced.
    if isinstance(value, six.string_types):
        value = [value, ]
    return ','.join([item for item in value]) 

Value is empty

@selwin
Copy link
Collaborator

selwin commented Jul 31, 2017

The patch for this issue was merged in just today #195 and was released on PyPI as 3.0.3

@kakulukia
Copy link
Contributor Author

i just upgraded my installation and currently pypi only lists 3.0.2 as the latest version .. will try again later .. cheers

@selwin
Copy link
Collaborator

selwin commented Jul 31, 2017 via email

@kakulukia
Copy link
Contributor Author

just installed from source because im preparing another PR and can confirm that adding email works in 3.0.3
BUT what about adding a log entry by hand, does that actually make sense?

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

2 participants