From da8890199abf13a2ff4b7825ce49d0cbace5e06f Mon Sep 17 00:00:00 2001 From: Helge Jung <hej@c3pb.de> Date: Wed, 18 Dec 2024 22:19:16 +0100 Subject: [PATCH] assembly team positioning: fix edit view --- src/backoffice/views/assemblyteam.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/backoffice/views/assemblyteam.py b/src/backoffice/views/assemblyteam.py index c1a1633e2..6e9654c63 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) -- GitLab