Displaying differences for changeset
 
display as  

services.py

@@ -2669,7 +2669,7 @@
         self.assessments = []
         self.load_registry()
 
-    def GET(self):
+    def get_registry_list(self):
         """Load all 'tracking sheet' options for UI to pick from"""
         import pdb; pdb.set_trace()
         # I think this is just the dictionary keys in the registry?
@@ -2678,7 +2678,7 @@
     def get_selected_registry(self, selected_tracking_sheet):
         """Fetch a particular tracking sheet"""
         if selected_tracking_sheet not in self.registry:
-            return "Unable to find specified tracking sheet "{0}" in the registry.".format(selected_tracking_sheet)
+            return "Unable to find specified tracking sheet '{0}' in the registry.".format(selected_tracking_sheet)
         for basin_data in self.registry[selected_tracking_sheet]:
             for site in basin_data["sites"]:
                 self.assessments.append(site)
@@ -2696,7 +2696,7 @@
             if b["basin"] == subBasin or b["name"] == subBasin
         ]
         if not ibasins:
-            return "Unable to save assessment {0} to the tracking list "{1}" because this basin is not part of the current assessment area.".format(subBasin, selected_tracking_sheet)
+            return "Unable to save assessment '{0}' to the tracking list '{1}' because this basin is not part of the current assessment area.".format(subBasin, selected_tracking_sheet)
 #             raise Exception(f"No basin named {subBasin} in assessment registry.")
         ibasin = ibasins[0]
         tracking_sheet_content = self.registry[selected_tracking_sheet][ibasin]

static/er2_303d_assess/js/reducers/assessment_tracking.js

@@ -11,13 +11,13 @@
 export type AssessmentTrackingType = {
     visible: boolean,
     registryList: string[],
-    selectedTrackingSheet: string
+    selectedTrackingSheet: string,
     registry: {
         basins: {
             name: string,
             basin: string,
         }[],
-    },
+    }[],
     assessments: AssessmentTrackingItemType[],
 }
 

views.py

@@ -317,7 +317,7 @@
 @csrf_exempt
 @return_with_exception
 def load_assessment_registry(request):
-    return svcs.Tracking(request=request).process()
+    return svcs.Tracking(request=request).get_registry_list()
 
 
 @csrf_exempt