Skip to content

Commit

Permalink
added v3 beta setting
Browse files Browse the repository at this point in the history
  • Loading branch information
vabene1111 committed Sep 26, 2024
1 parent 0a3611b commit ddaeb05
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
# Build Vue frontend
- uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
cache: yarn
cache-dependency-path: vue/yarn.lock
- name: Install dependencies
Expand All @@ -47,6 +47,19 @@ jobs:
working-directory: ./vue
run: yarn build

# Build Vue 3 frontend
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: yarn
cache-dependency-path: vue3/yarn.lock
- name: Install dependencies
working-directory: ./vue3
run: yarn install --frozen-lockfile
- name: Build dependencies
working-directory: ./vue3
run: yarn build

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Buildx
Expand Down
6 changes: 6 additions & 0 deletions cookbook/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@


def index(request):
if settings.V3_BETA:
return HttpResponseRedirect(reverse('vue3'))

with scopes_disabled():
if not request.user.is_authenticated:
if User.objects.count() < 1 and 'django.contrib.auth.backends.RemoteUserBackend' not in settings.AUTHENTICATION_BACKENDS:
Expand All @@ -52,6 +55,9 @@ def index(request):


def search(request):
if settings.V3_BETA:
return HttpResponseRedirect(reverse('vue3'))

if has_group_permission(request.user, ('guest', )):
return render(request, 'search.html', {})
else:
Expand Down
2 changes: 2 additions & 0 deletions recipes/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def extract_comma_list(env_key, default=None):
DEBUG = extract_bool('DEBUG', True)
DEBUG_TOOLBAR = extract_bool('DEBUG_TOOLBAR', True)

V3_BETA = extract_bool('V3_BETA', False)

LOG_LEVEL = os.getenv("LOG_LEVEL", "WARNING")

SOCIAL_DEFAULT_ACCESS = bool(int(os.getenv('SOCIAL_DEFAULT_ACCESS', False)))
Expand Down

0 comments on commit ddaeb05

Please sign in to comment.