Skip to content

Commit

Permalink
refactor - workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ananya173147 committed Oct 14, 2023
1 parent 57a6046 commit 22ca953
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
8 changes: 4 additions & 4 deletions Code/recommenderapp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
Module for routing all calls from the frontend
"""

import sys
sys.path.append("../../")
from Code.prediction_scripts.item_based import recommend_for_new_user

import json
import sys
from search import Search
from flask import Flask, jsonify, render_template, request
from flask_cors import CORS
from utils import send_email_to_user, beautify_feedback_data

sys.path.append("../../")
from Code.prediction_scripts.item_based import recommend_for_new_user

app = Flask(__name__)
app.secret_key = "secret key"

Expand Down
5 changes: 1 addition & 4 deletions Code/recommenderapp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import logging
import smtplib
from smtplib import SMTPException
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart

Expand Down Expand Up @@ -76,9 +77,5 @@ def send_email_to_user(recipient_email, categorized_data):
# Handle SMTP-related exceptions
logging.error("SMTP error while sending email: %s", str(e))

except Exception as e:
# Handle other exceptions
logging.error("An unexpected error occurred while sending email: %s", str(e))

finally:
server.quit()
5 changes: 2 additions & 3 deletions test/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
"""

import sys
sys.path.append("../")
from Code.recommenderapp.search import Search

import unittest
import warnings
sys.path.append("../")
from Code.recommenderapp.search import Search

warnings.filterwarnings("ignore")

Expand Down
4 changes: 2 additions & 2 deletions test/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"""

import sys
import unittest
import warnings
sys.path.append("../")
from Code.prediction_scripts.item_based import recommend_for_new_user

import unittest
import warnings
warnings.filterwarnings("ignore")


Expand Down

0 comments on commit 22ca953

Please sign in to comment.