Spaces:
Sleeping
Sleeping
keremberke
commited on
Upload 2 files
Browse files- app.py +1 -1
- db_utils.py +4 -3
app.py
CHANGED
@@ -30,4 +30,4 @@ with gr.Blocks(analytics_enabled=False) as demo:
|
|
30 |
apply_ai.click(fn=apply_ai_func, inputs=original_text, outputs=updated_text)
|
31 |
add_to_db.click(fn=add_updated_text_to_db, inputs=[text_id, updated_text])
|
32 |
|
33 |
-
demo.launch(auth=[("
|
|
|
30 |
apply_ai.click(fn=apply_ai_func, inputs=original_text, outputs=updated_text)
|
31 |
add_to_db.click(fn=add_updated_text_to_db, inputs=[text_id, updated_text])
|
32 |
|
33 |
+
demo.launch(auth=[("Kerem", PW), ("Mehmet", PW), ("Ege", PW), ("Ömer", PW)],favicon_path="./tugra_logo.png")
|
db_utils.py
CHANGED
@@ -7,7 +7,7 @@ from dotenv import load_dotenv
|
|
7 |
|
8 |
load_dotenv()
|
9 |
|
10 |
-
user_name_to_range = {'
|
11 |
|
12 |
url: str = os.environ.get("SUPABASE_URL")
|
13 |
key: str = os.environ.get("SUPABASE_KEY")
|
@@ -56,8 +56,9 @@ def get_text_by_row_id(id: int):
|
|
56 |
|
57 |
|
58 |
|
59 |
-
def add_updated_text_to_db(text: str):
|
60 |
-
|
|
|
61 |
|
62 |
|
63 |
|
|
|
7 |
|
8 |
load_dotenv()
|
9 |
|
10 |
+
user_name_to_range = {'Kerem': (700001, 900000), 'Mehmet': (1, 500000), 'Ege': (500001, 700000), 'Ömer': (700001, 1013817)}
|
11 |
|
12 |
url: str = os.environ.get("SUPABASE_URL")
|
13 |
key: str = os.environ.get("SUPABASE_KEY")
|
|
|
56 |
|
57 |
|
58 |
|
59 |
+
def add_updated_text_to_db(id: int, text: str):
|
60 |
+
data, count = supabase.table('eso-tr').update({'updated_text': text, 'done': True}).eq('id', id).execute()
|
61 |
+
|
62 |
|
63 |
|
64 |
|