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

Edit business unit fails if there is no machine group #76

Closed
thomas-dam opened this issue Nov 11, 2016 · 1 comment
Closed

Edit business unit fails if there is no machine group #76

thomas-dam opened this issue Nov 11, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@thomas-dam
Copy link

Reproduce:
Clean installation of Sal.
Create new business unit
Edit business unit.

Expected:
Should be able to correct name of business unit.

Result:



Request Method: GET
Request URL: http://REDACTED/business_unit/edit/1/

Django Version: 1.10
Python Version: 2.7.6
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'sal',
 'server',
 'api',
 'catalog',
 'inventory',
 'licenses',
 'bootstrap3',
 'watson',
 'datatableview',
 'search')
Installed Middleware:
('django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'server.middleware.AddToBU.AddToBU',
 'search.current_user.CurrentUserMiddleware')

Template loader postmortem
Django tried loading these templates, in this order:

Using engine django:
    * django.template.loaders.filesystem.Loader: /home/docker/sal/templates/{'business_unit': <BusinessUnit: TestUnit>, 'form': <EditUserBusinessUnitForm bound=False, valid=Unknown, fields=(name;users)>} (Source does not exist)
    * django.template.loaders.filesystem.Loader: /home/docker/sal/server/plugins/{'business_unit': <BusinessUnit: TestUnit>, 'form': <EditUserBusinessUnitForm bound=False, valid=Unknown, fields=(name;users)>} (Source does not exist)
    * django.template.loaders.filesystem.Loader: /home/docker/sal/plugins/{'business_unit': <BusinessUnit: TestUnit>, 'form': <EditUserBusinessUnitForm bound=False, valid=Unknown, fields=(name;users)>} (Source does not exist)
    * django.template.loaders.app_directories.Loader: /usr/local/lib/python2.7/dist-packages/django/contrib/auth/templates/{'business_unit': <BusinessUnit: TestUnit>, 'form': <EditUserBusinessUnitForm bound=False, valid=Unknown, fields=(name;users)>} (Source does not exist)
    * django.template.loaders.app_directories.Loader: /usr/local/lib/python2.7/dist-packages/django/contrib/admin/templates/{'business_unit': <BusinessUnit: TestUnit>, 'form': <EditUserBusinessUnitForm bound=False, valid=Unknown, fields=(name;users)>} (Source does not exist)
    * django.template.loaders.app_directories.Loader: /usr/local/lib/python2.7/dist-packages/django/contrib/admindocs/templates/{'business_unit': <BusinessUnit: TestUnit>, 'form': <EditUserBusinessUnitForm bound=False, valid=Unknown, fields=(name;users)>} (Source does not exist)
    * django.template.loaders.app_directories.Loader: /home/docker/sal/server/templates/{'business_unit': <BusinessUnit: TestUnit>, 'form': <EditUserBusinessUnitForm bound=False, valid=Unknown, fields=(name;users)>} (Source does not exist)
    * django.template.loaders.app_directories.Loader: /home/docker/sal/inventory/templates/{'business_unit': <BusinessUnit: TestUnit>, 'form': <EditUserBusinessUnitForm bound=False, valid=Unknown, fields=(name;users)>} (Source does not exist)
    * django.template.loaders.app_directories.Loader: /home/docker/sal/licenses/templates/{'business_unit': <BusinessUnit: TestUnit>, 'form': <EditUserBusinessUnitForm bound=False, valid=Unknown, fields=(name;users)>} (Source does not exist)
    * django.template.loaders.app_directories.Loader: /usr/local/lib/python2.7/dist-packages/bootstrap3/templates/{'business_unit': <BusinessUnit: TestUnit>, 'form': <EditUserBusinessUnitForm bound=False, valid=Unknown, fields=(name;users)>} (Source does not exist)
    * django.template.loaders.app_directories.Loader: /home/docker/sal/watson/templates/{'business_unit': <BusinessUnit: TestUnit>, 'form': <EditUserBusinessUnitForm bound=False, valid=Unknown, fields=(name;users)>} (Source does not exist)
    * django.template.loaders.app_directories.Loader: /home/docker/sal/datatableview/templates/{'business_unit': <BusinessUnit: TestUnit>, 'form': <EditUserBusinessUnitForm bound=False, valid=Unknown, fields=(name;users)>} (Source does not exist)
    * django.template.loaders.app_directories.Loader: /home/docker/sal/search/templates/{'business_unit': <BusinessUnit: TestUnit>, 'form': <EditUserBusinessUnitForm bound=False, valid=Unknown, fields=(name;users)>} (Source does not exist)



Traceback:

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py" in inner
  39.             response = get_response(request)

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _legacy_get_response
  249.             response = self._get_response(request)

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py" in _wrapped_view
  23.                 return view_func(request, *args, **kwargs)

File "/home/docker/sal/server/views.py" in edit_business_unit
  827.     return render('forms/edit_business_unit.html', c)

File "/usr/local/lib/python2.7/dist-packages/django/shortcuts.py" in render
  30.     content = loader.render_to_string(template_name, context, request, using=using)

File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in render_to_string
  67.         template = get_template(template_name, using=using)

File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in get_template
  25.     raise TemplateDoesNotExist(template_name, chain=chain)

Exception Type: TemplateDoesNotExist at /business_unit/edit/1/
Exception Value: {'business_unit': <BusinessUnit: TestUnit>, 'form': <EditUserBusinessUnitForm bound=False, valid=Unknown, fields=(name;users)>}

Workaround.
Creare machine group before editing business unit.

@grahamgilbert grahamgilbert self-assigned this Nov 12, 2016
@grahamgilbert grahamgilbert added this to the 3.0.0 milestone Nov 12, 2016
@grahamgilbert
Copy link
Member

Fixed in c9931de

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

No branches or pull requests

2 participants