Skip to content
Snippets Groups Projects
Commit 12cca9e2 authored by Marcus's avatar Marcus
Browse files

also support plain userinfo input

parent d5506c15
No related branches found
No related tags found
No related merge requests found
Pipeline #321712 failed
......@@ -20,11 +20,19 @@ def main():
print(message)
sys.exit(2)
if data["user"]["userinfo"] is None:
message = "Cannot process null input"
print(message)
try: # User.__init__ tries finding userinfo in data["user"]["userinfo"]
user = User(data)
except KeyError:
try:
data = {"user": {"userinfo": data}}
user = User(data)
except KeyError:
print("cannot find required information in input json.")
sys.exit(3)
except Exception as e:
print(F"Unhandled Exception: {e}")
raise
user = User(data)
print(f"User: {user.data.username}")
for grp in sorted(user.data.groups):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment