Skip to content

Add TeamCreateAPI view #937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

Oksamies
Copy link
Contributor

No description provided.

Copy link
Contributor Author

Oksamies commented Dec 11, 2023

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Oksamies Oksamies force-pushed the 12-11-Add_TeamCreateAPI_view branch 2 times, most recently from a4d49e7 to f078a48 Compare December 12, 2023 09:49
Copy link

codecov bot commented Dec 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (add-delete-user-endpoint@1d0e07f). Learn more about missing BASE report.

Current head f5c8062 differs from pull request most recent head ee40259

Please upload reports for the commit ee40259 to get more accurate results.

Additional details and impacted files
@@                     Coverage Diff                     @@
##             add-delete-user-endpoint     #937   +/-   ##
===========================================================
  Coverage                            ?   93.07%           
===========================================================
  Files                               ?      299           
  Lines                               ?     8755           
  Branches                            ?      780           
===========================================================
  Hits                                ?     8149           
  Misses                              ?      500           
  Partials                            ?      106           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@MythicManiac MythicManiac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small but important changes needed


form = CreateTeamForm(
user=request.user,
data=request.data,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neve ruse request.data directly when you use serializers to validate it; use serializer.validated_data

name = serializers.CharField()


class TeamCreateAPIView(APIView):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing permission classes (user needs to be authenticated)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the new views should now have IsAuthenticated

@Oksamies Oksamies force-pushed the 12-11-Add_TeamCreateAPI_view branch from dcd169a to 36350db Compare June 24, 2024 14:56
@Oksamies Oksamies force-pushed the add-delete-user-endpoint branch from 0645608 to 01b117e Compare June 24, 2024 14:59
@Oksamies Oksamies force-pushed the 12-11-Add_TeamCreateAPI_view branch from 36350db to 4e6236d Compare June 24, 2024 14:59
@Oksamies Oksamies force-pushed the add-delete-user-endpoint branch from 01b117e to 1d0e07f Compare June 24, 2024 16:09
@Oksamies Oksamies force-pushed the 12-11-Add_TeamCreateAPI_view branch 2 times, most recently from 5a9efff to ee40259 Compare June 24, 2024 16:47
@Oksamies Oksamies force-pushed the add-delete-user-endpoint branch from 1d0e07f to 018e671 Compare August 20, 2024 14:13
@Oksamies Oksamies force-pushed the 12-11-Add_TeamCreateAPI_view branch from ee40259 to 827af8b Compare August 20, 2024 14:14
@Oksamies Oksamies force-pushed the add-delete-user-endpoint branch from 018e671 to 6f34766 Compare September 10, 2024 11:21
@Oksamies Oksamies force-pushed the 12-11-Add_TeamCreateAPI_view branch from 827af8b to 18c615f Compare September 10, 2024 11:21
@@ -45,6 +46,40 @@ def check_permissions(self, request: Request) -> None:
raise PermissionDenied()


class CyberstormTeamCreateRequestSerialiazer(serializers.Serializer):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a typo in the class name: CyberstormTeamCreateRequestSerialiazer should be CyberstormTeamCreateRequestSerializer. The same typo appears in the response serializer class name as well.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@Roffenlund Roffenlund closed this Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants