MCPcopy Index your code
hub / github.com/diffgram/diffgram / guide_new_api

Function guide_new_api

default/methods/task/guide/guide_new.py:14–45  ·  view source on GitHub ↗
(project_string_id)

Source from the content-addressed store, hash-verified

12 Roles = ["admin", "Editor"],
13 apis_user_list = ['api_enabled_builder', 'security_email_verified'])
14def guide_new_api(project_string_id):
15
16 spec_list = [{"name" : str},
17 {"description_markdown": str}]
18
19 log, input, untrusted_input = regular_input.master(request=request,
20 spec_list=spec_list)
21 if len(log["error"].keys()) >= 1:
22 return jsonify(log=log), 400
23
24 with sessionMaker.session_scope() as session:
25
26 member = get_member(session = session)
27
28 ### MAIN ###
29 project = Project.get(session = session,
30 project_string_id = project_string_id)
31
32 guide = guide_new_core(session = session,
33 member = member,
34 name = input['name'],
35 description_markdown = input['description_markdown'],
36 project = project)
37 ### end main ###
38
39 log['success'] = True
40
41 # For ID
42 session.flush()
43
44 return jsonify(log = log,
45 guide = guide.serialize_for_list_view()), 200
46
47
48def guide_new_core(session,

Callers

nothing calls this directly

Calls 4

get_memberFunction · 0.85
guide_new_coreFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected