-
-
Notifications
You must be signed in to change notification settings - Fork 525
Update program admins relation #3185
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
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
ce14f4c
Update program admins relation
kasya 8aab4c9
Update local compose file db volume
kasya ad8fec3
Merge branch 'main' into update-program-admins
kasya 5fe73d5
Add Admin model. Update migration and logic.
kasya 8fefe8a
Clean up
kasya 0c2ce63
Merge branch 'update-program-admins' of github.com:OWASP/Nest into up…
kasya 689a68f
Update migration and code
kasya 11714c5
Run make-check
kasya 78fe8db
Merge branch 'main' of github.com:OWASP/Nest into update-program-admins
kasya ff2bea5
Merge branch 'main' of github.com:OWASP/Nest into update-program-admins
kasya 721bcb2
Fix N+1 issue
kasya cfea496
Merge branch 'main' of github.com:OWASP/Nest into update-program-admins
kasya 75589a2
Update docstrings
kasya 1ff5927
Revert accidental file push
kasya ada575b
Merge branch 'main' of github.com:OWASP/Nest into update-program-admins
kasya 601c1ba
Update migration
kasya d4d1fef
Merge branch 'main' of github.com:OWASP/Nest into update-program-admins
kasya 8d15fc9
Potential fix for pull request finding 'Empty except'
kasya b31feda
Merge branch 'main' into update-program-admins
kasya ec6ff17
Merge branch 'main' of github.com:OWASP/Nest into update-program-admins
kasya 120cf2a
Merge branch 'update-program-admins' of github.com:OWASP/Nest into up…
kasya f3ba9ae
Update code
arkid15r 893fe73
Update compose file
kasya 77afa1c
Merge branch 'main' into update-program-admins
kasya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| """Mentorship app Admin model admin.""" | ||
|
|
||
| from django.contrib import admin | ||
|
|
||
| from apps.mentorship.models.admin import Admin | ||
|
|
||
|
|
||
| class AdminAdmin(admin.ModelAdmin): | ||
| """Admin view for Admin model.""" | ||
|
|
||
| autocomplete_fields = ( | ||
| "github_user", | ||
| "nest_user", | ||
| ) | ||
|
|
||
| list_display = ("github_user",) | ||
|
|
||
| search_fields = ( | ||
| "github_user__login", | ||
| "github_user__name", | ||
| ) | ||
|
|
||
|
|
||
| admin.site.register(Admin, AdminAdmin) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| """GraphQL node for Admin model.""" | ||
|
|
||
| import strawberry | ||
|
|
||
|
|
||
| @strawberry.type | ||
| class AdminNode: | ||
| """A GraphQL node representing a mentorship admin.""" | ||
|
|
||
| id: strawberry.ID | ||
|
|
||
| @strawberry.field(name="avatarUrl") | ||
| def avatar_url(self) -> str: | ||
| """Get the GitHub avatar URL of the admin.""" | ||
| return self.github_user.avatar_url if self.github_user else "" | ||
|
|
||
| @strawberry.field | ||
| def login(self) -> str: | ||
| """Get the GitHub login of the admin.""" | ||
| return self.github_user.login if self.github_user else "" | ||
|
|
||
| @strawberry.field | ||
| def name(self) -> str: | ||
| """Get the GitHub name of the admin.""" | ||
| return self.github_user.name if self.github_user else "" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.