Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion oshc/main/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

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)

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)
Copy link
Member

@tapaswenipathak tapaswenipathak Oct 20, 2017

Choose a reason for hiding this comment

The 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.

Copy link
Member Author

Choose a reason for hiding this comment

The 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

Copy link
Member

@tapaswenipathak tapaswenipathak Oct 20, 2017

Choose a reason for hiding this comment

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

This one also has those changes (#160), that's why I closed that one.

In #160 you enabled the display of all the fields on the initial page. In this one you enabled the display as well as approval. Am I missing something here? 😕

Copy link
Member Author

Choose a reason for hiding this comment

The 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.
While sending PR I thought, I had sent two PR for different issues...and this was mine misunderstanding 😅😅