Skip to content

Commit

Permalink
added a flag to disable reset
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishankoradia committed Oct 8, 2024
1 parent cb9de45 commit 7a0afe7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ddpui/api/airbyte_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import List
from ninja.errors import HttpError
from ninja import Router
from flags.state import flag_enabled

from ddpui import auth
from ddpui import settings
Expand Down Expand Up @@ -481,6 +482,11 @@ def post_airbyte_connection_reset_v1(request, connection_id):
if org.airbyte_workspace_id is None:
raise HttpError(400, "create an airbyte workspace first")

if not flag_enabled("AIRBYTE_RESET_JOB", request_org_slug=org.slug):
raise HttpError(
400, "Reset job is disabled. Please contact the dalgo support team at support@dalgo.in"
)

_, error = airbytehelpers.reset_connection(org, connection_id)
if error:
raise HttpError(400, error)
Expand Down
3 changes: 2 additions & 1 deletion ddpui/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@
# Feature flags
# AIRBYTE_PROFILE: to get airbyte credentials through prefect block
# LOG_SUMMARY: allow summarizing logs through open AI
FLAGS = {"AIRBYTE_PROFILE": [], "LOG_SUMMARY": []}
# AIRBYTE_RESET_JOB: to reset airbyte connection
FLAGS = {"AIRBYTE_PROFILE": [], "LOG_SUMMARY": [], "AIRBYTE_RESET_JOB": []}

REST_FRAMEWORK = {
"DEFAULT_AUTHENTICATION_CLASSES": [
Expand Down

0 comments on commit 7a0afe7

Please sign in to comment.