Skip to content

Commit

Permalink
Merge pull request #243 from avantifellows/embeddable
Browse files Browse the repository at this point in the history
Make Plio Embeddable
  • Loading branch information
dalmia authored Sep 23, 2021
2 parents dce5a50 + 38af7ca commit c215163
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion organizations/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@
class OrganizationSerializer(serializers.ModelSerializer):
class Meta:
model = Organization
fields = ["id", "schema_name", "name", "shortcode", "created_at", "updated_at"]
fields = [
"id",
"schema_name",
"name",
"shortcode",
"api_key",
"created_at",
"updated_at",
]
read_only_fields = ["schema_name"]
4 changes: 2 additions & 2 deletions plio/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@ def test_user_list_plio_uuids(self):
},
)

def test_guest_cannot_play_plio(self):
def test_guest_can_play_plio(self):
# unset the credentials
self.client.credentials()
# play plio
response = self.client.get(f"/api/v1/plios/{self.plio_1.uuid}/play/")
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertEqual(response.status_code, status.HTTP_200_OK)

def test_user_can_play_own_plio(self):
# play plio
Expand Down
2 changes: 1 addition & 1 deletion plio/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def list_uuid(self, request):
@action(
methods=["get"],
detail=True,
permission_classes=[IsAuthenticated, PlioPermission],
permission_classes=[PlioPermission],
)
def play(self, request, uuid):
queryset = Plio.objects.filter(uuid=uuid)
Expand Down

0 comments on commit c215163

Please sign in to comment.