Skip to content

Commit

Permalink
Merge pull request #1380 from gtech-mulearn/dev
Browse files Browse the repository at this point in the history
org duplicate uuid issue
  • Loading branch information
adnankattekaden authored Oct 19, 2023
2 parents c2a5aef + 33a4473 commit 2c0d9c8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions api/dashboard/organisation/organisation_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def post(self, request):
"user_id": user_id
}
)

if serializer.is_valid():
serializer.save()

Expand Down Expand Up @@ -81,7 +80,6 @@ def put(self, request, org_code):
"user_id": user_id
}
)

if serializer.is_valid():
serializer.save()

Expand Down
2 changes: 1 addition & 1 deletion api/dashboard/organisation/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class Meta:

def create(self, validated_data):
user_id = self.context.get('user_id')
validated_data['id'] = str(uuid.uuid4())
validated_data['created_by_id'] = user_id
validated_data['updated_by_id'] = user_id

Expand All @@ -128,7 +129,6 @@ def update(self, instance, validated_data):
instance.code = validated_data.get('code', instance.code)
instance.affiliation = validated_data.get('affiliation', instance.affiliation)
instance.updated_by_id = user_id

instance.save()
return instance

Expand Down

0 comments on commit 2c0d9c8

Please sign in to comment.