File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -127,10 +127,18 @@ def load_remote_export_data(self):
127
127
# See: https://github.com/polis-community/red-dwarf/issues/55
128
128
if self ._is_statement_meta_field_missing ():
129
129
import warnings
130
- warnings .warn ("CSV import is missing is_meta field. Loading comments data from API instead..." )
131
- self .load_api_data_report ()
132
- self .conversation_id = self .report_data ["conversation_id" ]
133
- self .load_api_data_comments ()
130
+ warnings .warn ("CSV import is missing is_meta field. Attempting to load comments data from API instead..." )
131
+ try :
132
+ if self .report_id and not self .conversation_id :
133
+ self .load_api_data_report ()
134
+ self .conversation_id = self .report_data ["conversation_id" ]
135
+ self .load_api_data_comments ()
136
+ except Exception :
137
+ raise ValueError (" " .join ([
138
+ "Due to an upstream bug, we must patch CSV exports using the API," ,
139
+ "so conversation_id or report_id is required." ,
140
+ "See: https://github.com/polis-community/red-dwarf/issues/56" ,
141
+ ]))
134
142
135
143
# When multiple votes (same tid and pid), keep only most recent (vs first).
136
144
self .filter_duplicate_votes (keep = "recent" )
You can’t perform that action at this time.
0 commit comments