Commit 62982d7a authored by marcus.hardt's avatar marcus.hardt

Merge branch 'fix-attribute-error-on-group-create' into 'master'

Fix attribute error on group create

See merge request !26
parents 2f23108d 6bcfe7b4
......@@ -276,9 +276,13 @@ class Group:
def create(self):
rsp = BWIDM.get('group-admin', 'create', CONFIG['backend.bwidm.service']['name'], self.name).json()
if self.name != rsp.name:
logger.warning("Groupname changed from {} to {} by BWIDM".format(self.name, rsp.name))
self.name = rsp.name
try:
if self.name != rsp.name:
logger.warning("Groupname changed from {} to {} by BWIDM".format(self.name, rsp.name))
self.name = rsp.name
except AttributeError as e:
logger.error(F"Did not obtain a json with group name back: {e}")
logger.error(F"What is got is {rsp}")
self.id = rsp.id
......
......@@ -105,7 +105,7 @@ class Question(Questionnaire):
if default:
kwargs['defaults'] = {name: default}
super().__init__(questions={name: text}, **kwargs)
super().__init__(questions={name: text}, defaults={name: ''}, **kwargs)
def raise_question(*args, **kwargs):
"""Convenice function needed in places where an expression is required.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment