ghga-de/datameta

Unclear statement at `POST:/service`

ckaipf opened this issue · 0 comments

try:
service = Service(
name = name,
site_id = siteid.generate(request, Service))
db.add(service)
db.flush()
except IntegrityError:
raise get_validation_error(["A service with that name already exists."])
# Return for the new service the ID, name and all associated Users
users = []
for user in service.users:
users.append(get_identifier(user))
return ServiceResponse(
id = resource.get_identifier(service),
name = service.name,
user_ids = users
)

This seems not quite clear to me, we create a new Service with Service.users not set. Then we get service.users, which should always be empty?