Skip to content

Commit

Permalink
Added search bar in Django Admin Users and competitions pages as well…
Browse files Browse the repository at this point in the history
… as some filters
  • Loading branch information
Obada Haddad committed Jan 10, 2025
1 parent b66732b commit cc8ccc6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM --platform=linux/amd64 python:3.8.3
RUN curl -sL https://deb.nodesource.com/setup_4.x | bash -
RUN apt-get update && apt-get install -y npm netcat nodejs python-dev libmemcached-dev

RUN pip install --upgrade pip # make things faster, hopefully
#RUN pip install --upgrade pip # make things faster, hopefully
COPY codalab/requirements/requirements.txt requirements.txt
RUN pip install -r requirements.txt

Expand Down
6 changes: 5 additions & 1 deletion codalab/apps/authenz/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@

from .models import ClUser

class UserAdmin(admin.ModelAdmin):
search_fields = ['username', 'email']
list_filter = ['is_staff', 'is_superuser']
list_display = ['username', 'email', 'is_staff', 'is_superuser']

admin.site.register(ClUser)
admin.site.register(ClUser, UserAdmin)
2 changes: 2 additions & 0 deletions codalab/apps/web/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class CompetitionAdmin(admin.ModelAdmin):
PhaseInlineAdmin,
ParticipantInlineAdmin
]
search_fields = ['title', 'creator__username']
list_display = ['title', 'creator']
admin.site.register(models.Competition, CompetitionAdmin)


Expand Down

0 comments on commit cc8ccc6

Please sign in to comment.