Cannot add device to a rack #233

Closed
opened 2025-12-29 16:19:50 +01:00 by adam · 13 comments
Owner

Originally created by @drook on GitHub (Jul 18, 2016).

Netbox v1.2.2
Python 2.7.10

Rack name does contain national characters.
After clicking on "add device" I got a 500 answer, stacktrace follows:

UnicodeEncodeError at /dcim/devices/add/

'ascii' codec can't encode characters in position 0-15: ordinal not in range(128)

Request Method:     GET
Request URL:    http://netbox.norma.perm.ru/dcim/devices/add/?site=1&rack=1&face=0&position=1
Django Version:     1.9.7
Exception Type:     UnicodeEncodeError
Exception Value:    

'ascii' codec can't encode characters in position 0-15: ordinal not in range(128)

Exception Location:     /usr/local/lib/python2.7/site-packages/django/utils/html.py in format_html, line 101
Python Executable:  /usr/local/bin/python
Python Version:     2.7.10
Python Path:    

['/usr/local/bin',
 '/usr/local/bin',
 '/var/www/netbox/netbox',
 '/usr/local/lib/python27.zip',
 '/usr/local/lib/python2.7',
 '/usr/local/lib/python2.7/plat-freebsd10',
 '/usr/local/lib/python2.7/lib-tk',
 '/usr/local/lib/python2.7/lib-old',
 '/usr/local/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/site-packages']

Server time:    Mon, 18 Jul 2016 12:30:09 +0000


Unicode error hint

The string that could not be encoded/decoded was: Коммуникационная стой
Error during template rendering

In template /var/www/netbox/netbox/templates/dcim/device_edit.html, error at line 0
ascii
1   {% extends 'utilities/obj_edit.html' %}
2   {% load form_helpers %}
3   
4   {% block form %}
5       <div class="panel panel-default">
6           <div class="panel-heading"><strong>Device</strong></div>
7           <div class="panel-body">
8               {% render_field form.name %}
9               {% render_field form.device_role %}
10          </div>
Traceback Switch to copy-and-paste view 
Originally created by @drook on GitHub (Jul 18, 2016). Netbox v1.2.2 Python 2.7.10 Rack name does contain national characters. After clicking on "add device" I got a 500 answer, stacktrace follows: ``` stacktrace UnicodeEncodeError at /dcim/devices/add/ 'ascii' codec can't encode characters in position 0-15: ordinal not in range(128) Request Method: GET Request URL: http://netbox.norma.perm.ru/dcim/devices/add/?site=1&rack=1&face=0&position=1 Django Version: 1.9.7 Exception Type: UnicodeEncodeError Exception Value: 'ascii' codec can't encode characters in position 0-15: ordinal not in range(128) Exception Location: /usr/local/lib/python2.7/site-packages/django/utils/html.py in format_html, line 101 Python Executable: /usr/local/bin/python Python Version: 2.7.10 Python Path: ['/usr/local/bin', '/usr/local/bin', '/var/www/netbox/netbox', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-freebsd10', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages'] Server time: Mon, 18 Jul 2016 12:30:09 +0000 Unicode error hint The string that could not be encoded/decoded was: Коммуникационная стой Error during template rendering In template /var/www/netbox/netbox/templates/dcim/device_edit.html, error at line 0 ascii 1 {% extends 'utilities/obj_edit.html' %} 2 {% load form_helpers %} 3 4 {% block form %} 5 <div class="panel panel-default"> 6 <div class="panel-heading"><strong>Device</strong></div> 7 <div class="panel-body"> 8 {% render_field form.name %} 9 {% render_field form.device_role %} 10 </div> Traceback Switch to copy-and-paste view ```
adam added the type: bug label 2025-12-29 16:19:50 +01:00
adam closed this issue 2025-12-29 16:19:50 +01:00
Author
Owner

@drook commented on GitHub (Jul 18, 2016):

Eventually I discovered that now browsing racks gives the same error:


UnicodeEncodeError at /dcim/racks/

'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)

Request Method:     GET
Request URL:    http://netbox.norma.perm.ru/dcim/racks/?group_id=2
Django Version:     1.9.7
Exception Type:     UnicodeEncodeError
Exception Value:    

'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)

Exception Location:     /var/www/netbox/netbox/dcim/forms.py in rack_site_choices, line 178
Python Executable:  /usr/local/bin/python
Python Version:     2.7.10
Python Path:    

['/usr/local/bin',
 '/usr/local/bin',
 '/var/www/netbox/netbox',
 '/usr/local/lib/python27.zip',
 '/usr/local/lib/python2.7',
 '/usr/local/lib/python2.7/plat-freebsd10',
 '/usr/local/lib/python2.7/lib-tk',
 '/usr/local/lib/python2.7/lib-old',
 '/usr/local/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/site-packages']

Server time:    Mon, 18 Jul 2016 13:15:00 +0000
Unicode error hint

The string that could not be encoded/decoded was: Космонавтов, 65
Error during template rendering

In template /var/www/netbox/netbox/templates/dcim/rack_list.html, error at line 21
ascii
11              Add a rack
12          </a>
13          <a href="{% url 'dcim:rack_import' %}" class="btn btn-info">
14              <span class="glyphicon glyphicon-import" aria-hidden="true"></span>
15              Import racks
16          </a>
17      {% endif %}
18      {% include 'inc/export_button.html' with obj_type='racks' %}
19  </div>
20  <h1>Racks</h1>
21  <div class="row">
22      <div class="col-md-9">
23          {% include 'utilities/obj_table.html' with bulk_edit_url='dcim:rack_bulk_edit' bulk_delete_url='dcim:rack_bulk_delete' %}
24      </div>
25      <div class="col-md-3">
26          <div class="panel panel-default">
27              <div class="panel-heading">
28                  <span class="glyphicon glyphicon-search" aria-hidden="true"></span> 
29                  <strong>Search</strong>
30              </div>
31              <div class="panel-body">
Traceback Switch to copy-and-paste view 
@drook commented on GitHub (Jul 18, 2016): Eventually I discovered that now browsing racks gives the same error: ``` traceback UnicodeEncodeError at /dcim/racks/ 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128) Request Method: GET Request URL: http://netbox.norma.perm.ru/dcim/racks/?group_id=2 Django Version: 1.9.7 Exception Type: UnicodeEncodeError Exception Value: 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128) Exception Location: /var/www/netbox/netbox/dcim/forms.py in rack_site_choices, line 178 Python Executable: /usr/local/bin/python Python Version: 2.7.10 Python Path: ['/usr/local/bin', '/usr/local/bin', '/var/www/netbox/netbox', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-freebsd10', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages'] Server time: Mon, 18 Jul 2016 13:15:00 +0000 Unicode error hint The string that could not be encoded/decoded was: Космонавтов, 65 Error during template rendering In template /var/www/netbox/netbox/templates/dcim/rack_list.html, error at line 21 ascii 11 Add a rack 12 </a> 13 <a href="{% url 'dcim:rack_import' %}" class="btn btn-info"> 14 <span class="glyphicon glyphicon-import" aria-hidden="true"></span> 15 Import racks 16 </a> 17 {% endif %} 18 {% include 'inc/export_button.html' with obj_type='racks' %} 19 </div> 20 <h1>Racks</h1> 21 <div class="row"> 22 <div class="col-md-9"> 23 {% include 'utilities/obj_table.html' with bulk_edit_url='dcim:rack_bulk_edit' bulk_delete_url='dcim:rack_bulk_delete' %} 24 </div> 25 <div class="col-md-3"> 26 <div class="panel panel-default"> 27 <div class="panel-heading"> 28 <span class="glyphicon glyphicon-search" aria-hidden="true"></span> 29 <strong>Search</strong> 30 </div> 31 <div class="panel-body"> Traceback Switch to copy-and-paste view ```
Author
Owner

@jeremystretch commented on GitHub (Jul 18, 2016):

Should be fixed in 0d46a65.

@jeremystretch commented on GitHub (Jul 18, 2016): Should be fixed in 0d46a65.
Author
Owner

@drook commented on GitHub (Jul 19, 2016):

Still there is 1.3.0:


UnicodeEncodeError at /dcim/racks/

'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)

Request Method:     GET
Request URL:    http://netbox.norma.perm.ru/dcim/racks/
Django Version:     1.9.7
Exception Type:     UnicodeEncodeError
Exception Value:    

'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)

Exception Location:     /var/www/netbox/netbox/dcim/forms.py in rack_site_choices, line 178
Python Executable:  /usr/local/bin/python
Python Version:     2.7.10
Python Path:    

['/usr/local/bin',
 '/usr/local/bin',
 '/var/www/netbox/netbox',
 '/usr/local/lib/python27.zip',
 '/usr/local/lib/python2.7',
 '/usr/local/lib/python2.7/plat-freebsd10',
 '/usr/local/lib/python2.7/lib-tk',
 '/usr/local/lib/python2.7/lib-old',
 '/usr/local/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/site-packages']

Server time:    Tue, 19 Jul 2016 08:06:42 +0000
Unicode error hint

The string that could not be encoded/decoded was: Космонавтов, 65
Error during template rendering

In template /var/www/netbox/netbox/templates/dcim/rack_list.html, error at line 21
ascii
11              Add a rack
12          </a>
13          <a href="{% url 'dcim:rack_import' %}" class="btn btn-info">
14              <span class="glyphicon glyphicon-import" aria-hidden="true"></span>
15              Import racks
16          </a>
17      {% endif %}
18      {% include 'inc/export_button.html' with obj_type='racks' %}
19  </div>
20  <h1>Racks</h1>
21  <div class="row">
22      <div class="col-md-9">
23          {% include 'utilities/obj_table.html' with bulk_edit_url='dcim:rack_bulk_edit' bulk_delete_url='dcim:rack_bulk_delete' %}
24      </div>
25      <div class="col-md-3">
26          <div class="panel panel-default">
27              <div class="panel-heading">
28                  <span class="glyphicon glyphicon-search" aria-hidden="true"></span> 
29                  <strong>Search</strong>
30              </div>
31              <div class="panel-body">
Traceback Switch to copy-and-paste view 
@drook commented on GitHub (Jul 19, 2016): Still there is 1.3.0: ``` traceback UnicodeEncodeError at /dcim/racks/ 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128) Request Method: GET Request URL: http://netbox.norma.perm.ru/dcim/racks/ Django Version: 1.9.7 Exception Type: UnicodeEncodeError Exception Value: 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128) Exception Location: /var/www/netbox/netbox/dcim/forms.py in rack_site_choices, line 178 Python Executable: /usr/local/bin/python Python Version: 2.7.10 Python Path: ['/usr/local/bin', '/usr/local/bin', '/var/www/netbox/netbox', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-freebsd10', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages'] Server time: Tue, 19 Jul 2016 08:06:42 +0000 Unicode error hint The string that could not be encoded/decoded was: Космонавтов, 65 Error during template rendering In template /var/www/netbox/netbox/templates/dcim/rack_list.html, error at line 21 ascii 11 Add a rack 12 </a> 13 <a href="{% url 'dcim:rack_import' %}" class="btn btn-info"> 14 <span class="glyphicon glyphicon-import" aria-hidden="true"></span> 15 Import racks 16 </a> 17 {% endif %} 18 {% include 'inc/export_button.html' with obj_type='racks' %} 19 </div> 20 <h1>Racks</h1> 21 <div class="row"> 22 <div class="col-md-9"> 23 {% include 'utilities/obj_table.html' with bulk_edit_url='dcim:rack_bulk_edit' bulk_delete_url='dcim:rack_bulk_delete' %} 24 </div> 25 <div class="col-md-3"> 26 <div class="panel panel-default"> 27 <div class="panel-heading"> 28 <span class="glyphicon glyphicon-search" aria-hidden="true"></span> 29 <strong>Search</strong> 30 </div> 31 <div class="panel-body"> Traceback Switch to copy-and-paste view ```
Author
Owner

@drook commented on GitHub (Jul 19, 2016):

Actually, modifications from the commit you are referencing didn't make it into models.py or forms.py. When added manually, it starts to work.

@drook commented on GitHub (Jul 19, 2016): Actually, modifications from the commit you are referencing didn't make it into models.py or forms.py. When added manually, it starts to work.
Author
Owner

@drook commented on GitHub (Jul 19, 2016):

But I'm still unable to add device, and, since the traceback doesn't mention what script it has crashed in (and I'm not really a python guy) I cannot figure out where to put the fix to:


UnicodeEncodeError at /dcim/devices/add/

'ascii' codec can't encode characters in position 0-15: ordinal not in range(128)

Request Method:     GET
Request URL:    http://netbox.norma.perm.ru/dcim/devices/add/?site=1&rack=1&face=0&position=1
Django Version:     1.9.7
Exception Type:     UnicodeEncodeError
Exception Value:    

'ascii' codec can't encode characters in position 0-15: ordinal not in range(128)

Exception Location:     /usr/local/lib/python2.7/site-packages/django/utils/html.py in format_html, line 101
Python Executable:  /usr/local/bin/python
Python Version:     2.7.10
Python Path:    

['/usr/local/bin',
 '/usr/local/bin',
 '/var/www/netbox/netbox',
 '/usr/local/lib/python27.zip',
 '/usr/local/lib/python2.7',
 '/usr/local/lib/python2.7/plat-freebsd10',
 '/usr/local/lib/python2.7/lib-tk',
 '/usr/local/lib/python2.7/lib-old',
 '/usr/local/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/site-packages']

Server time:    Tue, 19 Jul 2016 08:11:55 +0000
Unicode error hint

The string that could not be encoded/decoded was: Коммуникационная стой
Error during template rendering

In template /var/www/netbox/netbox/templates/dcim/device_edit.html, error at line 0
ascii
1   {% extends 'utilities/obj_edit.html' %}
2   {% load form_helpers %}
3   
4   {% block form %}
5       <div class="panel panel-default">
6           <div class="panel-heading"><strong>Device</strong></div>
7           <div class="panel-body">
8               {% render_field form.name %}
9               {% render_field form.device_role %}
10          </div>
Traceback Switch to copy-and-paste view 
@drook commented on GitHub (Jul 19, 2016): But I'm still unable to add device, and, since the traceback doesn't mention what script it has crashed in (and I'm not really a python guy) I cannot figure out where to put the fix to: ``` traceback UnicodeEncodeError at /dcim/devices/add/ 'ascii' codec can't encode characters in position 0-15: ordinal not in range(128) Request Method: GET Request URL: http://netbox.norma.perm.ru/dcim/devices/add/?site=1&rack=1&face=0&position=1 Django Version: 1.9.7 Exception Type: UnicodeEncodeError Exception Value: 'ascii' codec can't encode characters in position 0-15: ordinal not in range(128) Exception Location: /usr/local/lib/python2.7/site-packages/django/utils/html.py in format_html, line 101 Python Executable: /usr/local/bin/python Python Version: 2.7.10 Python Path: ['/usr/local/bin', '/usr/local/bin', '/var/www/netbox/netbox', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-freebsd10', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages'] Server time: Tue, 19 Jul 2016 08:11:55 +0000 Unicode error hint The string that could not be encoded/decoded was: Коммуникационная стой Error during template rendering In template /var/www/netbox/netbox/templates/dcim/device_edit.html, error at line 0 ascii 1 {% extends 'utilities/obj_edit.html' %} 2 {% load form_helpers %} 3 4 {% block form %} 5 <div class="panel panel-default"> 6 <div class="panel-heading"><strong>Device</strong></div> 7 <div class="panel-body"> 8 {% render_field form.name %} 9 {% render_field form.device_role %} 10 </div> Traceback Switch to copy-and-paste view ```
Author
Owner

@jeremystretch commented on GitHub (Jul 19, 2016):

Actually, modifications from the commit you are referencing didn't make it into models.py or forms.py. When added manually, it starts to work.

It sounds like you haven't pulled the new code down. There should be no reason to add these changes manually. Revert the edits you made and run git pull origin develop.

@jeremystretch commented on GitHub (Jul 19, 2016): > Actually, modifications from the commit you are referencing didn't make it into models.py or forms.py. When added manually, it starts to work. It sounds like you haven't pulled the new code down. There should be no reason to add these changes manually. Revert the edits you made and run `git pull origin develop`.
Author
Owner

@drook commented on GitHub (Jul 21, 2016):

Well, I just renamed my old netbox directory to 'netbox.old', checked out the develop branch into an empty 'netbox' directory, and reinitialized the whole installation with a newly checked tree (since it's almost empty anyway), just to be sure, and the error is still there. Furthermore, 0d46a65 does mention netbox/dcim/forms.py around line 63 only, but it does looks like it needs this fix around line 178, where the netbox crashes.

[root@twilight:www/netbox]# git remote show origin
* remote origin
  Fetch URL: https://github.com/digitalocean/netbox
  Push  URL: https://github.com/digitalocean/netbox
  HEAD branch: develop
  Remote branches:
    develop            tracked
    master             tracked
    secrets-api-filter tracked
  Local branch configured for 'git pull':
    develop merges with remote develop
  Local ref configured for 'git push':
    develop pushes to develop (up to date)
[root@twilight:www/netbox]# git branch            
* develop
[root@twilight:www/netbox]# git pull
Already up-to-date.
[root@twilight:www/netbox]# git status
On branch develop
Your branch is up-to-date with 'origin/develop'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   upgrade.sh

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        netbox/static/

no changes added to commit (use "git add" and/or "git commit -a")
[root@twilight:www/netbox]#

(yup, I modified upgrade.sh script a bit, just to suit my needs and get rid of sudo).

UnicodeEncodeError at /dcim/racks/

'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)

Request Method:     GET
Request URL:    http://netbox.norma.perm.ru/dcim/racks/
Django Version:     1.9.7
Exception Type:     UnicodeEncodeError
Exception Value:    

'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)

Exception Location:     /var/www/netbox/netbox/dcim/forms.py in rack_site_choices, line 178
Python Executable:  /usr/local/bin/python
Python Version:     2.7.12
Python Path:    

['/var/www/netbox/netbox',
 '/usr/local/lib/python27.zip',
 '/usr/local/lib/python2.7',
 '/usr/local/lib/python2.7/plat-freebsd10',
 '/usr/local/lib/python2.7/lib-tk',
 '/usr/local/lib/python2.7/lib-old',
 '/usr/local/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/site-packages']

Server time:    Wed, 20 Jul 2016 10:40:28 +0000
Unicode error hint

The string that could not be encoded/decoded was: Космонавтов, 65
Error during template rendering

In template /var/www/netbox/netbox/templates/dcim/rack_list.html, error at line 21
ascii
11              Add a rack
12          </a>
13          <a href="{% url 'dcim:rack_import' %}" class="btn btn-info">
14              <span class="glyphicon glyphicon-import" aria-hidden="true"></span>
15              Import racks
16          </a>
17      {% endif %}
18      {% include 'inc/export_button.html' with obj_type='racks' %}
19  </div>
20  <h1>Racks</h1>
21  <div class="row">
22      <div class="col-md-9">
23          {% include 'utilities/obj_table.html' with bulk_edit_url='dcim:rack_bulk_edit' bulk_delete_url='dcim:rack_bulk_delete' %}
24      </div>
25      <div class="col-md-3">
26          <div class="panel panel-default">
27              <div class="panel-heading">
28                  <span class="glyphicon glyphicon-search" aria-hidden="true"></span> 
29                  <strong>Search</strong>
30              </div>
31              <div class="panel-body">
Traceback Switch to copy-and-paste view 
@drook commented on GitHub (Jul 21, 2016): Well, I just renamed my old netbox directory to 'netbox.old', checked out the develop branch into an empty 'netbox' directory, and reinitialized the whole installation with a newly checked tree (since it's almost empty anyway), just to be sure, and the error is still there. Furthermore, 0d46a65 does mention netbox/dcim/forms.py around line 63 only, but it does looks like it needs this fix around line 178, where the netbox crashes. ``` git [root@twilight:www/netbox]# git remote show origin * remote origin Fetch URL: https://github.com/digitalocean/netbox Push URL: https://github.com/digitalocean/netbox HEAD branch: develop Remote branches: develop tracked master tracked secrets-api-filter tracked Local branch configured for 'git pull': develop merges with remote develop Local ref configured for 'git push': develop pushes to develop (up to date) [root@twilight:www/netbox]# git branch * develop [root@twilight:www/netbox]# git pull Already up-to-date. [root@twilight:www/netbox]# git status On branch develop Your branch is up-to-date with 'origin/develop'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: upgrade.sh Untracked files: (use "git add <file>..." to include in what will be committed) netbox/static/ no changes added to commit (use "git add" and/or "git commit -a") [root@twilight:www/netbox]# ``` (yup, I modified upgrade.sh script a bit, just to suit my needs and get rid of sudo). ``` traceback UnicodeEncodeError at /dcim/racks/ 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128) Request Method: GET Request URL: http://netbox.norma.perm.ru/dcim/racks/ Django Version: 1.9.7 Exception Type: UnicodeEncodeError Exception Value: 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128) Exception Location: /var/www/netbox/netbox/dcim/forms.py in rack_site_choices, line 178 Python Executable: /usr/local/bin/python Python Version: 2.7.12 Python Path: ['/var/www/netbox/netbox', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-freebsd10', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages'] Server time: Wed, 20 Jul 2016 10:40:28 +0000 Unicode error hint The string that could not be encoded/decoded was: Космонавтов, 65 Error during template rendering In template /var/www/netbox/netbox/templates/dcim/rack_list.html, error at line 21 ascii 11 Add a rack 12 </a> 13 <a href="{% url 'dcim:rack_import' %}" class="btn btn-info"> 14 <span class="glyphicon glyphicon-import" aria-hidden="true"></span> 15 Import racks 16 </a> 17 {% endif %} 18 {% include 'inc/export_button.html' with obj_type='racks' %} 19 </div> 20 <h1>Racks</h1> 21 <div class="row"> 22 <div class="col-md-9"> 23 {% include 'utilities/obj_table.html' with bulk_edit_url='dcim:rack_bulk_edit' bulk_delete_url='dcim:rack_bulk_delete' %} 24 </div> 25 <div class="col-md-3"> 26 <div class="panel panel-default"> 27 <div class="panel-heading"> 28 <span class="glyphicon glyphicon-search" aria-hidden="true"></span> 29 <strong>Search</strong> 30 </div> 31 <div class="panel-body"> Traceback Switch to copy-and-paste view ```
Author
Owner

@drook commented on GitHub (Jul 21, 2016):

I modified netbox/dcim/forms.py like shown below, and the bug is finally gone.

--- forms.py.orig       2016-07-21 10:18:47.587212484 +0500
+++ forms.py    2016-07-21 10:18:55.739211481 +0500
@@ -175,7 +175,7 @@

 def rack_site_choices():
     site_choices = Site.objects.annotate(rack_count=Count('racks'))
-    return [(s.slug, '{} ({})'.format(s.name, s.rack_count)) for s in site_choices]
+    return [(s.slug, u'{} ({})'.format(s.name, s.rack_count)) for s in site_choices]


 def rack_group_choices():

@drook commented on GitHub (Jul 21, 2016): I modified netbox/dcim/forms.py like shown below, and the bug is finally gone. ``` patch --- forms.py.orig 2016-07-21 10:18:47.587212484 +0500 +++ forms.py 2016-07-21 10:18:55.739211481 +0500 @@ -175,7 +175,7 @@ def rack_site_choices(): site_choices = Site.objects.annotate(rack_count=Count('racks')) - return [(s.slug, '{} ({})'.format(s.name, s.rack_count)) for s in site_choices] + return [(s.slug, u'{} ({})'.format(s.name, s.rack_count)) for s in site_choices] def rack_group_choices(): ```
Author
Owner

@drook commented on GitHub (Jul 21, 2016):

Same fix needs to be applied to netbox/ipam/forms.py line 543.

@drook commented on GitHub (Jul 21, 2016): Same fix needs to be applied to netbox/ipam/forms.py line 543.
Author
Owner

@drook commented on GitHub (Jul 21, 2016):

And netbox/ipam/forms.py line 458.

@drook commented on GitHub (Jul 21, 2016): And netbox/ipam/forms.py line 458.
Author
Owner

@drook commented on GitHub (Jul 21, 2016):

...and netbox/dcim/forms.py line 551.

@drook commented on GitHub (Jul 21, 2016): ...and netbox/dcim/forms.py line 551.
Author
Owner

@drook commented on GitHub (Jul 21, 2016):

...and in netbox/ipam/forms.py line 269.

@drook commented on GitHub (Jul 21, 2016): ...and in netbox/ipam/forms.py line 269.
Author
Owner

@drook commented on GitHub (Jul 21, 2016):

...and in netbox/dcim/forms.py line 94.

@drook commented on GitHub (Jul 21, 2016): ...and in netbox/dcim/forms.py line 94.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#233