diff --git a/bims/api_views/location_site.py b/bims/api_views/location_site.py index 366247c30..f9132f840 100644 --- a/bims/api_views/location_site.py +++ b/bims/api_views/location_site.py @@ -538,7 +538,7 @@ def get_site_details(self, site_id): overview['{} Site Code'.format( preferences.SiteSetting.default_site_name )] = location_site.site_code - overview['Original Site Code'] = location_site.legacy_site_code + overview['User Site Code'] = location_site.legacy_site_code overview['Site coordinates'] = ( 'Longitude: {long}, Latitude: {lat}'.format( long=self.parse_string(location_site.longitude), diff --git a/bims/api_views/location_site_public.py b/bims/api_views/location_site_public.py index 23fda798f..808a4ad26 100644 --- a/bims/api_views/location_site_public.py +++ b/bims/api_views/location_site_public.py @@ -237,7 +237,7 @@ def get_site_details(self, site_id): overview['{} Site Code'.format( preferences.SiteSetting.default_site_name )] = location_site.site_code - overview['Original Site Code'] = location_site.legacy_site_code + overview['User Site Code'] = location_site.legacy_site_code overview['Site coordinates'] = ( 'Longitude: {long}, Latitude: {lat}'.format( long=self.parse_string(location_site.longitude), diff --git a/bims/scripts/collection_csv_keys.py b/bims/scripts/collection_csv_keys.py index 970bba75c..256d93c6d 100644 --- a/bims/scripts/collection_csv_keys.py +++ b/bims/scripts/collection_csv_keys.py @@ -6,6 +6,7 @@ WETLAND_NAME = 'Original Wetland Name' LOCATION_SITE = 'Original River Name' ORIGINAL_SITE_CODE = 'Original Site Code' +USER_SITE_CODE = 'User Site Code' ORIGINAL_RIVER_NAME = 'Original River Name' FBIS_SITE_CODE = 'FBIS Site Code' SITE_DESCRIPTION = 'Site description' diff --git a/bims/scripts/occurrences_upload.py b/bims/scripts/occurrences_upload.py index fcbb83604..31259acff 100644 --- a/bims/scripts/occurrences_upload.py +++ b/bims/scripts/occurrences_upload.py @@ -259,7 +259,10 @@ def location_site(self, record): longitude, latitude) # Create or get location site - legacy_site_code = DataCSVUpload.row_value(record, ORIGINAL_SITE_CODE) + legacy_site_code = DataCSVUpload.row_value(record, USER_SITE_CODE) + if not legacy_site_code: + legacy_site_code = DataCSVUpload.row_value( + record, ORIGINAL_SITE_CODE) location_site_name = '' if DataCSVUpload.row_value(record, LOCATION_SITE): location_site_name = DataCSVUpload.row_value(record, LOCATION_SITE) diff --git a/bims/serializers/bio_collection_serializer.py b/bims/serializers/bio_collection_serializer.py index 25ad70471..912410031 100644 --- a/bims/serializers/bio_collection_serializer.py +++ b/bims/serializers/bio_collection_serializer.py @@ -97,7 +97,7 @@ class BioCollectionOneRowSerializer( uuid = serializers.SerializerMethodField() original_river_name = serializers.SerializerMethodField() site_code = serializers.SerializerMethodField() - original_site_code = serializers.SerializerMethodField() + user_site_code = serializers.SerializerMethodField() site_description = serializers.SerializerMethodField() refined_geomorphological_zone = serializers.SerializerMethodField() river_name = serializers.SerializerMethodField() @@ -277,7 +277,7 @@ def get_conservation_status_national(self, obj): def get_site_code(self, obj): return obj.site.site_code - def get_original_site_code(self, obj): + def get_user_site_code(self, obj): return obj.site.legacy_site_code def get_river_name(self, obj): @@ -603,7 +603,7 @@ class Meta: 'uuid', 'original_river_name', 'river_name', - 'original_site_code', + 'user_site_code', 'site_code', 'site_description', 'refined_geomorphological_zone', diff --git a/bims/static/data/physico_chemical_template.csv b/bims/static/data/physico_chemical_template.csv index d5170e051..833100630 100644 --- a/bims/static/data/physico_chemical_template.csv +++ b/bims/static/data/physico_chemical_template.csv @@ -1 +1 @@ -UUID,Original Wetland Name,Original Site Code,Site Code,Site description,Latitude,Longitude,Sampling Date,Collector/Owner,Collector/Owner Institute,Author(s),Year,Source,Title,Reference category,URL,DOI,Document Upload Link,Notes,AL,BOD,CA,CACO3,CHLA-B,CHLA-W,CL,CO3,COD,COL,COND,CR,CU,DIN,DO,DON,DOPER,ECOLI,FCB,FE,FE,HCO3,KJN,KJN,MG,NA,NH3-N,NH4-N,NO2+NO3,NO2-N,NO3-N,PB,pH,POM,SI,SO4,SRP,TAL,TDS,TEMP,TIC,TOC,TORGS,TOT-N,TOT-P,TSS,TURB,ZN +UUID,Original Wetland Name,User Site Code,Site Code,Site description,Latitude,Longitude,Sampling Date,Collector/Owner,Collector/Owner Institute,Author(s),Year,Source,Title,Reference category,URL,DOI,Document Upload Link,Notes,AL,BOD,CA,CACO3,CHLA-B,CHLA-W,CL,CO3,COD,COL,COND,CR,CU,DIN,DO,DON,DOPER,ECOLI,FCB,FE,FE,HCO3,KJN,KJN,MG,NA,NH3-N,NH4-N,NO2+NO3,NO2-N,NO3-N,PB,pH,POM,SI,SO4,SRP,TAL,TDS,TEMP,TIC,TOC,TORGS,TOT-N,TOT-P,TSS,TURB,ZN diff --git a/bims/templates/includes/overview_table.html b/bims/templates/includes/overview_table.html index a4cd4131d..cf1931366 100644 --- a/bims/templates/includes/overview_table.html +++ b/bims/templates/includes/overview_table.html @@ -16,8 +16,8 @@