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

Not selecting severity while creating an issue causes exception #96

Open
nangia opened this issue Oct 4, 2016 · 1 comment
Open

Not selecting severity while creating an issue causes exception #96

nangia opened this issue Oct 4, 2016 · 1 comment

Comments

@nangia
Copy link

nangia commented Oct 4, 2016

Thanks a lot for this great utility.

I was just was trying to use statuspage (statuspage==0.8.1). Found that I ran into following exception when trying to run statuspage update.

Generating..
Traceback (most recent call last):
  File "/Users/sandeep/bin/virtualenv/hbank12sep2016/bin/statuspage", line 11, in <module>
sys.exit(cli())
  File "/Users/sandeep/bin/virtualenv/hbank12sep2016/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/Users/sandeep/bin/virtualenv/hbank12sep2016/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/Users/sandeep/bin/virtualenv/hbank12sep2016/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/sandeep/bin/virtualenv/hbank12sep2016/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/sandeep/bin/virtualenv/hbank12sep2016/lib/python2.7/site-packages/click/core.py", line 534, in invoke
  return callback(*args, **kwargs)
  File "/Users/sandeep/bin/virtualenv/hbank12sep2016/lib/python2.7/site-packages/statuspage/statuspage.py", line 73, in update
run_update(name=name, token=token, org=org)
  File "/Users/sandeep/bin/virtualenv/hbank12sep2016/lib/python2.7/site-packages/statuspage/statuspage.py", line 200, in run_update
"systems": systems, "incidents": incidents, "panels": panels, "config": config
  File "/Users/sandeep/bin/virtualenv/hbank12sep2016/lib/python2.7/site-packages/jinja2/environment.py", line 989, in render
return self.environment.handle_exception(exc_info, True)
  File "/Users/sandeep/bin/virtualenv/hbank12sep2016/lib/python2.7/site-packages/jinja2/environment.py", line 754, in handle_exception
reraise(exc_type, exc_value, tb)
  File "<template>", line 38, in top-level template code
jinja2.exceptions.UndefinedError: 'None' has no attribute 'capitalize'

I read through the code and figured that this will happen if severity labels are not selected while creating an issue. Thus severity will be None when being evaluated in template.html and causes an exception when trying to evaluate severity.capitalize. It might be a good idea to check this in the code and give a more user friendly message.

@orels1
Copy link
Contributor

orels1 commented Apr 12, 2017

I opened PR with the fix #149

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