ninuxorg/nodeshot — Issue #73: UnicodeEncodeError when adding a node in certain cases
Author: nemesisdesign
Created: 2012-02-17 23:40:08+00:00
State: open
Labels: Bug

Inserting a special character like – (\u2013) in the name field of a node causes an internal server error.

This is the stacktrace:

```python
Traceback (most recent call last):

File "/home/ninux/nodeshot/venv/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)

File "/home/ninux/nodeshot/venv/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 77, in wrapped_view
return view_func(*args, **kwargs)

File "/home/ninux/nodeshot/nodeshot/views.py", line 525, in add_node
node.save()

File "/home/ninux/nodeshot/nodeshot/models.py", line 248, in save
self.set_activation_key()

File "/home/ninux/nodeshot/nodeshot/models.py", line 198, in set_activation_key
self.activation_key = sha_constructor(salt+self.name).hexdigest()

UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 16: ordinal not in range(128)
```
Post data:

```python
POST:,
```