-
Notifications
You must be signed in to change notification settings - Fork 56
Added option to approve multiple contest in Admin Dashboard #162
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,5 +10,18 @@ class chatSessionAdmin(admin.ModelAdmin): | |
| list_display = ('title', 'start_date') | ||
|
|
||
|
|
||
| class contestAdmin(admin.ModelAdmin): | ||
| list_display = ('name', 'link', 'description', 'start_date', 'end_date', 'approved') | ||
| actions = ['approve_contest'] | ||
|
|
||
| def approve_contest(self, request, queryset): | ||
| contest_approved = queryset.update(approved=True) | ||
| if contest_approved == 1: | ||
| message_bit = "1 contest" | ||
| else: | ||
| message_bit = "{} contests were".format(contest_approved) | ||
| self.message_user(request, "{} approved.".format(message_bit)) | ||
| approve_contest.short_description = "Approve" | ||
|
|
||
| admin.site.register(chatSession, chatSessionAdmin) | ||
| admin.site.register(Contest) | ||
| admin.site.register(Contest, contestAdmin) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aah you are doing this in parts? :) I will close that one then. We can have a reject as well.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tapasweni-pathak I think I failed to express why I opened the PR you closed... actually what I think that before Approval we will look at the authenticity of contest so to do that you have to click on each contest if user had submitted 10 contests .....so I made this process easy by displaying all the fields in dashboard only. Let me know your thoughts
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tapasweni-pathak I am really sorry!! 😅😅 I don't how this happened...and yes thanks for merging. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (88 > 79 characters)