Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Commit

Permalink
[bug 809575] Don't generate dropdowns in admin for UserProfiles.
Browse files Browse the repository at this point in the history
Different models such as 'Groups' and 'UserProfile' use ForeignKeys to
UserProfile which due to the size causes issues. To avoid long
waiting, even timeouts, when using Admin Panel we don't generate
dropdowns for UserProfiles.
  • Loading branch information
glogiotatidis committed Nov 19, 2012
1 parent 751696f commit 18f9c3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions apps/groups/admin.py
Expand Up @@ -6,5 +6,6 @@
class GroupAdmin(admin.ModelAdmin):
list_display = ['name', 'steward', 'wiki', 'website', 'irc_channel']
search_fields = ['name']
raw_id_fields = ['steward']

admin.site.register(Group, GroupAdmin)
4 changes: 3 additions & 1 deletion apps/users/admin.py
@@ -1,15 +1,17 @@
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.contrib.auth.models import Group, User

from models import UserProfile, UsernameBlacklist

admin.site.unregister(User)
admin.site.unregister(Group)


class UserProfileInline(admin.StackedInline):
"""UserProfile Inline model for UserAdmin."""
model = UserProfile
raw_id_fields = ['vouched_by']


class UserAdmin(UserAdmin):
Expand Down

0 comments on commit 18f9c3c

Please sign in to comment.