mirror of
				https://github.com/django/django.git
				synced 2025-10-26 07:06:08 +00:00 
			
		
		
		
	Fixed #21907 -- Fixed add_srs_entry for Spatialite >= 4
Thanks dfunckt for the report.
This commit is contained in:
		| @@ -64,9 +64,11 @@ def add_srs_entry(srs, auth_name='EPSG', auth_srid=None, ref_sys_name=None, | |||||||
|               } |               } | ||||||
|  |  | ||||||
|     # Backend-specific fields for the SpatialRefSys model. |     # Backend-specific fields for the SpatialRefSys model. | ||||||
|     if connection.ops.postgis: |     srs_field_names = SpatialRefSys._meta.get_all_field_names() | ||||||
|  |     if 'srtext' in srs_field_names: | ||||||
|         kwargs['srtext'] = srs.wkt |         kwargs['srtext'] = srs.wkt | ||||||
|     if connection.ops.spatialite: |     if 'ref_sys_name' in srs_field_names: | ||||||
|  |         # Spatialite specific | ||||||
|         kwargs['ref_sys_name'] = ref_sys_name or srs.name |         kwargs['ref_sys_name'] = ref_sys_name or srs.name | ||||||
|  |  | ||||||
|     # Creating the spatial_ref_sys model. |     # Creating the spatial_ref_sys model. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user