Duplicate ModelAdmin options defined in OrderOptions

Create issue
Issue #1425 resolved
Darren Hollenbeck created an issue

The list_filter and date_hierarchy options are both assigned twice in the OrderOptions class in satchmo_store/shop/admin.py. I think this was probably a bad merge done in the past but I can't find where in the source history in bitbake.

Last one wins obviously, but for clarity's sake the duplicate should probably be removed. Also, if filter by contact was intended to be allowed the first list_filter should be used rather than the second.

{{{ #!python

class OrderOptions(AutocompleteAdmin): fieldsets = ( (None, {'fields': ('site', 'contact', 'method', 'status', 'discount_code', 'notes')}), (('Shipping Method'), {'fields': ('shipping_method', 'shipping_description')}), (('Shipping Address'), {'classes': ('collapse',), 'fields': ('ship_street1', 'ship_street2', 'ship_city', 'ship_state', 'ship_postal_code', 'ship_country')}), (('Billing Address'), {'classes': ('collapse',), 'fields': ('bill_street1', 'bill_street2', 'bill_city', 'bill_state', 'bill_postal_code', 'bill_country')}), (('Totals'), {'fields': ('sub_total', 'shipping_cost', 'shipping_discount', 'tax', 'discount', 'total', 'time_stamp')})) list_display = ('id', 'contact', 'time_stamp', 'order_total', 'balance_forward', 'status', 'invoice', 'packingslip', 'shippinglabel') list_filter = ['time_stamp', 'contact', 'status'] date_hierarchy = 'time_stamp' list_filter = ['time_stamp', 'status'] date_hierarchy = 'time_stamp' search_fields = ('contactfirst_name', 'contactlast_name', 'contact__email') related_search_fields = {'contact': ('first_name', 'last_name', 'email')} related_string_functions = {'contact': lambda c: u"%s <%s>" % (c.full_name, c.email)} inlines = [OrderItem_Inline, OrderStatus_Inline, OrderVariable_Inline, OrderTaxDetail_Inline, OrderAuthorizationDetail_Inline, OrderPaymentDetail_Inline, OrderPaymentFailureDetail_Inline] readonly_fields = ('status',) }}}

Comments (2)

  1. Log in to comment