Skip to content

Commit

Permalink
remove to internal method in serialiser
Browse files Browse the repository at this point in the history
  • Loading branch information
mayofaulkner committed Apr 10, 2024
1 parent e5997c7 commit c4470f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
9 changes: 0 additions & 9 deletions alyx/experiments/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@ class TrajectoryEstimateSerializer(serializers.ModelSerializer):
queryset=CoordinateSystem.objects.all(),
)

def to_internal_value(self, data):
if data.get('chronic_insertion', None) is None:
data['chronic_insertion'] = None

if data.get('probe_insertion', None) is None:
data['probe_insertion'] = None

return super(TrajectoryEstimateSerializer, self).to_internal_value(data)

class Meta:
model = TrajectoryEstimate
fields = '__all__'
Expand Down
3 changes: 3 additions & 0 deletions alyx/experiments/tests_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def test_create_list_delete_trajectory(self):
# create a trajectory
url = reverse('trajectoryestimate-list')
tdict = {'probe_insertion': alyx_insertion['id'],
'chronic_insertion': None,
'x': -4521.2,
'y': 2415.0,
'z': 0,
Expand Down Expand Up @@ -216,6 +217,7 @@ def test_create_list_delete_channels(self):
# create the probe insertion
pi = self.ar(self.post(reverse('probeinsertion-list'), self.dict_insertion), 201)
tdict = {'probe_insertion': pi['id'],
'chronic_insertion': None,
'x': -4521.2,
'y': 2415.0,
'z': 0,
Expand Down Expand Up @@ -273,6 +275,7 @@ def test_chronic_insertion(self):

# create a trajectory and attach it to the chronic insertion
traj_dict = {'chronic_insertion': ci['id'],
'probe_insertion': None,
'x': -4521.2,
'y': 2415.0,
'z': 0,
Expand Down

0 comments on commit c4470f2

Please sign in to comment.