Update modules/database.py
Browse files- modules/database.py +14 -0
modules/database.py
CHANGED
@@ -132,6 +132,20 @@ def get_user(username):
|
|
132 |
print(f"Error al obtener usuario {username}: {str(e)}")
|
133 |
return None
|
134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
#######################################################################################################
|
136 |
def store_morphosyntax_result(username, text, repeated_words, arc_diagrams):
|
137 |
if analysis_collection is None:
|
|
|
132 |
print(f"Error al obtener usuario {username}: {str(e)}")
|
133 |
return None
|
134 |
|
135 |
+
#######################################################################################################
|
136 |
+
def store_application_request(name, email, institution, role, reason):
|
137 |
+
try:
|
138 |
+
query = """
|
139 |
+
INSERT INTO application_requests (name, email, institution, role, reason, request_date)
|
140 |
+
VALUES (?, ?, ?, ?, ?, GETDATE())
|
141 |
+
"""
|
142 |
+
user_container.execute(query, name, email, institution, role, reason)
|
143 |
+
logger.info(f"Application request stored for email: {email}")
|
144 |
+
return True
|
145 |
+
except Exception as e:
|
146 |
+
logger.error(f"Error storing application request: {str(e)}")
|
147 |
+
return False
|
148 |
+
|
149 |
#######################################################################################################
|
150 |
def store_morphosyntax_result(username, text, repeated_words, arc_diagrams):
|
151 |
if analysis_collection is None:
|