Skip to content

Commit

Permalink
Merge pull request #297 from Deep-Chill/issue-296
Browse files Browse the repository at this point in the history
Conditionally display Group Buy (#296)

This switch default to not display "bulk buyer" option.
  • Loading branch information
smirolo authored Mar 19, 2024
2 parents d7e538a + 4b5ab6d commit 706bc1c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions saas/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
'CSV_CUSTOMER_CONTACTS_INCLUDED': True,
'DEFAULT_UNIT': 'usd',
'DISABLE_UPDATES': False,
'DISPLAY_BULK_BUYER_TOGGLE': False,
'EXPIRE_NOTICE_DAYS': [15],
'EXTRA_MIXIN': object,
'EXTRA_FIELD': None,
Expand Down Expand Up @@ -182,6 +183,7 @@
CSV_CUSTOMER_CONTACTS_INCLUDED = _SETTINGS.get('CSV_CUSTOMER_CONTACTS_INCLUDED')
DEFAULT_UNIT = _SETTINGS.get('DEFAULT_UNIT')
DISABLE_UPDATES = _SETTINGS.get('DISABLE_UPDATES')
DISPLAY_BULK_BUYER_TOGGLE = _SETTINGS.get('DISPLAY_BULK_BUYER_TOGGLE')
EXPIRE_NOTICE_DAYS = _SETTINGS.get('EXPIRE_NOTICE_DAYS')
EXTRA_MIXIN = _SETTINGS.get('EXTRA_MIXIN')
INACTIVITY_DAYS = _SETTINGS.get('INACTIVITY_DAYS')
Expand Down
2 changes: 1 addition & 1 deletion saas/views/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def get_form_class(self):

def get_initial(self):
kwargs = super(OrganizationProfileView, self).get_initial()
if Plan.objects.exists():
if Plan.objects.exists() and settings.DISPLAY_BULK_BUYER_TOGGLE:
# Do not display the bulk buying option if there are no plans.
kwargs.update({'is_bulk_buyer': self.object.is_bulk_buyer})
if _valid_manager(self.request, [get_broker()]):
Expand Down

0 comments on commit 706bc1c

Please sign in to comment.