Skip to content

Commit

Permalink
Add the "open_frugal_mode_control" setting option.
Browse files Browse the repository at this point in the history
  • Loading branch information
WongSaang committed Apr 17, 2023
1 parent 15d5583 commit 0db602b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions chat/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
def load_default_settings(sender, **kwargs):
if sender.name == 'chat':
print('Setting up default settings...')
if not Setting.objects.filter(name='openai_api_key').exists():
Setting.objects.create(name='openai_api_key')
print('Created setting: openai_api_key')
if not Setting.objects.filter(name='open_frugal_mode_control').exists():
Setting.objects.create(name='open_frugal_mode_control', value='True')
print('Created setting: open_frugal_mode_control')
if not Setting.objects.filter(name='open_registration').exists():
Setting.objects.create(name='open_registration', value='True')
print('Created setting: open_registration')
Expand Down
3 changes: 2 additions & 1 deletion chat/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def get_queryset(self):
available_names = [
'open_registration',
'open_web_search',
'open_api_key_setting'
'open_api_key_setting',
'open_frugal_mode_control',
]
return Setting.objects.filter(name__in=available_names)

Expand Down

0 comments on commit 0db602b

Please sign in to comment.