mirror of
https://github.com/pinry/pinry.git
synced 2026-03-12 15:10:35 +01:00
Fix: Fix possible error for board rename
This commit is contained in:
@@ -225,7 +225,7 @@ class BoardSerializer(serializers.HyperlinkedModelSerializer):
|
||||
submitter=instance.submitter,
|
||||
name=validated_data.get('name', None)
|
||||
).first()
|
||||
if board.id != instance.id:
|
||||
if board and board.id != instance.id:
|
||||
raise ValidationError(
|
||||
detail={'name': "Board with this name already exists"}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user