Skip to content
This repository has been archived by the owner on Nov 26, 2018. It is now read-only.

Commit

Permalink
Fix admin.
Browse files Browse the repository at this point in the history
  • Loading branch information
vbabiy committed Nov 2, 2015
1 parent ef73141 commit 2740f4d
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions botbot/apps/bots/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,30 +76,15 @@ def has_add_permission(self, request):

def get_queryset(self, request):
qs = super(PublicChannelApproval, self).get_queryset(request)
return qs.filter(is_pending=True, is_public=True)
return qs.filter(status=self.model.ACTIVE, is_public=True)


class PersonalChannelApproval(ChannelAdmin):
def has_add_permission(self, request):
return False

def get_queryset(self, request):
qs = super(PersonalChannelApproval, self).get_queryset(request)
return qs.filter(is_pending=True, is_public=False)

class PublicChannels(models.Channel):
class Meta:
proxy = True
verbose_name = "Pending Public Channel"

class PersonalChannels(models.Channel):
class Meta:
proxy = True
verbose_name = "Pending Personal Channel"


admin.site.register(PublicChannels, PublicChannelApproval)
admin.site.register(PersonalChannels, PersonalChannelApproval)

admin.site.register(models.ChatBot, ChatBotAdmin)
admin.site.register(models.Channel, ChannelAdmin)
Expand Down

0 comments on commit 2740f4d

Please sign in to comment.