Skip to content

Commit

Permalink
silly bug + cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Yugi committed Feb 9, 2024
1 parent 61c4b5e commit 2b45c79
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ def index():
password=os.environ.get("MYSQL_PASSWORD"),
database=os.environ.get("MYSQL_DATABASE"),
)
hadithsToIndex = []

cursor = connection.cursor(pymysql.cursors.DictCursor)
# Arabic Hadiths
cursor.execute(
Expand Down Expand Up @@ -139,11 +137,8 @@ def index():
if englishHadith["urn"] not in matchingArabicHadiths:
continue
matchingArabic = matchingArabicHadiths[englishHadith["urn"]]
englishHadith = {
**englishHadith,
"arabicText": matchingArabic["arabicText"],
"hadithNumber": matchingArabic["hadithNumber"],
}
englishHadith["arabicText"] = matchingArabic["arabicText"]
englishHadith["hadithNumber"] = matchingArabic["hadithNumber"]

englishSuccessCount, englishErrors = create_and_update_index(
"english", englishHadiths, ["urn", "matchingArabicURN"]
Expand All @@ -165,7 +160,6 @@ def index():

@app.route("/<language>/search", methods=["GET"])
def search(language):
print(language)
query = request.args.get("q")
# TODO: 'query_string' is strict and does not allow syntax erorrs. Compare to current behavior
query_dsl = {
Expand Down

0 comments on commit 2b45c79

Please sign in to comment.