Skip to content

Commit 28e5e72

Browse files
committed
idk
1 parent e08ff47 commit 28e5e72

File tree

2 files changed

+70
-11
lines changed

2 files changed

+70
-11
lines changed

backend/endpoints/logfile.txt

+65-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Document D
1010
sorted_list end
1111

1212
versioned_docs begin
13-
[<onshape_api.paths.paths.InstancePath object at 0x7fb355579ac0>, <onshape_api.paths.paths.InstancePath object at 0x7fb3555796d0>, <onshape_api.paths.paths.InstancePath object at 0x7fb3555796a0>, <onshape_api.paths.paths.InstancePath object at 0x7fb355578080>]
13+
[<onshape_api.paths.paths.InstancePath object at 0x7fb35557b260>, <onshape_api.paths.paths.InstancePath object at 0x7fb3555a0680>, <onshape_api.paths.paths.InstancePath object at 0x7fb3555a1340>, <onshape_api.paths.paths.InstancePath object at 0x7fb3555a1520>]
1414
versioned_docs end
1515

1616
curr_instance begin
@@ -25,7 +25,7 @@ Document D
2525
sorted_list end
2626

2727
versioned_docs begin
28-
[<onshape_api.paths.paths.InstancePath object at 0x7fb3555a1310>, <onshape_api.paths.paths.InstancePath object at 0x7fb3555a20c0>, <onshape_api.paths.paths.InstancePath object at 0x7fb3555a1550>, <onshape_api.paths.paths.InstancePath object at 0x7fb3555a18b0>]
28+
[<onshape_api.paths.paths.InstancePath object at 0x7fb3555b8230>, <onshape_api.paths.paths.InstancePath object at 0x7fb355578710>, <onshape_api.paths.paths.InstancePath object at 0x7fb355579be0>, <onshape_api.paths.paths.InstancePath object at 0x7fb35557ae70>]
2929
versioned_docs end
3030

3131
curr_instance begin
@@ -39,7 +39,67 @@ Document C
3939
Document D
4040
sorted_list end
4141

42-
versioned_docs begin
43-
[<onshape_api.paths.paths.InstancePath object at 0x7fb35695b920>, <onshape_api.paths.paths.InstancePath object at 0x7fb3555a1670>, <onshape_api.paths.paths.InstancePath object at 0x7fb3555a0830>, <onshape_api.paths.paths.InstancePath object at 0x7fb3555a1730>]
44-
versioned_docs end
42+
updated_references begin
43+
6
44+
updated_references end
45+
46+
curr_instance begin
47+
/d/839f2ae3b61462b2924dd8dd/w/cb58acd8fcb444681d733ab5
48+
curr_instance end
49+
50+
sorted_list begin
51+
Document A
52+
Document B
53+
Document C
54+
Document D
55+
sorted_list end
56+
57+
updated_references begin
58+
6
59+
updated_references end
60+
61+
curr_instance begin
62+
/d/839f2ae3b61462b2924dd8dd/w/cb58acd8fcb444681d733ab5
63+
curr_instance end
64+
65+
sorted_list begin
66+
Document A
67+
Document B
68+
Document C
69+
Document D
70+
sorted_list end
71+
72+
updated_references begin
73+
6
74+
updated_references end
75+
76+
curr_instance begin
77+
/d/839f2ae3b61462b2924dd8dd/w/cb58acd8fcb444681d733ab5
78+
curr_instance end
79+
80+
sorted_list begin
81+
Document A
82+
Document B
83+
Document C
84+
Document D
85+
sorted_list end
86+
87+
updated_references begin
88+
6
89+
updated_references end
90+
91+
curr_instance begin
92+
/d/839f2ae3b61462b2924dd8dd/w/cb58acd8fcb444681d733ab5
93+
curr_instance end
94+
95+
sorted_list begin
96+
Document A
97+
Document B
98+
Document C
99+
Document D
100+
sorted_list end
101+
102+
updated_references begin
103+
6
104+
updated_references end
45105

backend/endpoints/references.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -200,17 +200,16 @@ def get_linked_parents(db, instance):
200200

201201
updated_references = 0
202202
for update_instance in sorted_list:
203-
versions.create_version(api, update_instance, name, description)
204-
versioned_docs.append(update_instance)
205203

206204
updated_references += do_update_references(
207-
api, update_instance, [doc.document_id for doc in versioned_docs]
205+
api, update_instance, [doc.document_id for doc in sorted_list]
208206
)
207+
versions.create_version(api, update_instance, name, description)
209208

210209
with open("backend/endpoints/logfile.txt", "a") as log_file:
211210

212-
log_file.write("versioned_docs begin\n")
213-
log_file.write(f"{versioned_docs}\n")
214-
log_file.write("versioned_docs end\n\n")
211+
log_file.write("updated_references begin\n")
212+
log_file.write(f"{updated_references}\n")
213+
log_file.write("updated_references end\n\n")
215214

216215
return {"updatedReferences": updated_references}

0 commit comments

Comments
 (0)