Commit 19c53ca9 authored by Marcus's avatar Marcus

catch AttributeError and log it

parent 2f23108d
......@@ -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
......
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