diff --git a/src/backoffice/views/assemblyteam.py b/src/backoffice/views/assemblyteam.py index c1a1633e23fba064273768a566970cf8c91751f6..6e9654c63c176d8713dcf37f7e4bd3ae0af9be03 100644 --- a/src/backoffice/views/assemblyteam.py +++ b/src/backoffice/views/assemblyteam.py @@ -568,9 +568,9 @@ class AssemblyEditPlacementView(SingleAssemblyTeamMixin, View): old_values = { 'state': assembly.state, - 'location_point': assembly.get_location_point_xy(), - 'location_boundaries': assembly.get_location_boundaries_xy(), - 'location_floor': assembly.get_location_floor_index(), + 'location_point': assembly.get_location_point_xy() or '', + 'location_boundaries': assembly.get_location_boundaries_xy() or '', + 'location_floor': str(assembly.get_location_floor_index() or ''), } changes = {} try: @@ -582,11 +582,11 @@ class AssemblyEditPlacementView(SingleAssemblyTeamMixin, View): # assembly.location_point = Point(x=parsed[0], y=parsed[1], srid=self.SRID) assembly.location_data['point'] = parsed - changes['location_point'] = str(assembly.location_point) + changes['location_point'] = poi else: # assembly.location_point = None assembly.location_data['point'] = None - changes['location_point'] = str(None) + changes['location_point'] = '' if boundaries and boundaries != '""': parsed = json.loads(boundaries) @@ -594,20 +594,20 @@ class AssemblyEditPlacementView(SingleAssemblyTeamMixin, View): # assembly.location_boundaries = MultiPolygon([Polygon(item) for item in parsed], srid=self.SRID) assembly.location_data['boundaries'] = parsed - changes['location_boundaries'] = str(assembly.location_boundaries) + changes['location_boundaries'] = boundaries else: # assembly.location_boundaries = None assembly.location_data['boundaries'] = None - changes['location_boundaries'] = str(None) + changes['location_boundaries'] = '' if floor and floor != '""': parsed = int(floor) assembly.location_floor = self.conference.map_floors.filter(index=parsed).first() - changes['location_floor'] = str(assembly.location_floor.index) + changes['location_floor'] = str(assembly.get_location_floor_index() or '') else: assembly.location_floor = None - changes['location_floor'] = str(None) + changes['location_floor'] = '' except ValueError: logger.exception('Failed to update position of assembly %s', assembly.pk)