added conditon to allow only add admin to access add club#21
Open
shanky2003g wants to merge 1 commit into
Open
added conditon to allow only add admin to access add club#21shanky2003g wants to merge 1 commit into
shanky2003g wants to merge 1 commit into
Conversation
mittal-parth
requested changes
Mar 6, 2024
mittal-parth
left a comment
Owner
There was a problem hiding this comment.
Thanks!
- Create a different branch from your main and submit a new PR. The convention is to do that and not from a fork's main to my main.
- Rename the title to be more concise. Also, tense should be 'add' and not added
| messages.success(request, 'Club added successfully!') | ||
| return redirect('/') | ||
| # Adding a new club | ||
| if can_user_access(request.user.id, 'club_add'): # preventing convenor and member to access add clubs |
Owner
There was a problem hiding this comment.
Suggested change
| if can_user_access(request.user.id, 'club_add'): # preventing convenor and member to access add clubs | |
| if can_user_access(request.user.id, 'club_add'): |
We need not hardcode who has access in the comments.
| messages.success(request, 'Club added successfully!') | ||
| return redirect('/') | ||
| else: | ||
| return redirect('error_page') |
Owner
There was a problem hiding this comment.
Suggested change
| return redirect('error_page') | |
| return render(request, 'error_page.html') |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Initially club member and convenor both were able to access user add page by simply modifying the url to http://127.0.0.1:8000/user_add/. Added an if condition to check whether user has an action to perform user_add else will redirect to error page.