Browse Source

Merge branch 'member-nickname-search' of opi/coin into master

jocelyn 8 years ago
parent
commit
c45ac21255
3 changed files with 4 additions and 3 deletions
  1. 1 1
      coin/members/admin.py
  2. 1 1
      coin/members/autocomplete_light_registry.py
  3. 2 1
      coin/offers/admin.py

+ 1 - 1
coin/members/admin.py

@@ -60,7 +60,7 @@ class MemberAdmin(UserAdmin):
                     'end_date_of_membership')
     list_display_links = ('id', 'username', 'first_name', 'last_name')
     list_filter = ('status', MembershipFeeFilter)
-    search_fields = ['username', 'first_name', 'last_name', 'email']
+    search_fields = ['username', 'first_name', 'last_name', 'email', 'nickname']
     ordering = ('status', 'username')
     actions = [delete_selected, 'set_as_member', 'set_as_non_member',
                'bulk_send_welcome_email', 'bulk_send_call_for_membership_fee_email']

+ 1 - 1
coin/members/autocomplete_light_registry.py

@@ -9,7 +9,7 @@ autocomplete_light.register(Member,
                             # Just like in ModelAdmin.search_fields
                             search_fields=[
                                 '^first_name', 'last_name', 'organization_name',
-                                'username'],
+                                'username', 'nickname'],
                             # This will actually data-minimum-characters which
                             # will set widget.autocomplete.minimumCharacters.
                             autocomplete_js_attributes={

+ 2 - 1
coin/offers/admin.py

@@ -34,7 +34,8 @@ class OfferSubscriptionAdmin(admin.ModelAdmin):
     list_filter = ( OfferSubscriptionTerminationFilter,
                     OfferSubscriptionCommitmentFilter,
                     'offer', 'member')
-    search_fields = ['member__first_name', 'member__last_name', 'member__email']
+    search_fields = ['member__first_name', 'member__last_name', 'member__email',
+                     'member__nickname']
     
     fields = (
                 'member',