diff --git a/app.py b/app.py index a5cb9af..27185cb 100644 --- a/app.py +++ b/app.py @@ -9,7 +9,7 @@ app = Flask(__name__) DATABASE = './database.db' -app.secret_key = 'some_secret' +app.secret_key = 'zH2l72&X#Ho^5iWnc7@#nbdmHK63XmG1' app.config.update( SESSION_COOKIE_SECURE=True, @@ -286,7 +286,6 @@ def serve(userid): result[i]["updated"] = row[5] result[i]["description"] = row[6] result[i]["link"] = row[8] - result[i]["private"] = row[9] return json.dumps(result) @@ -334,7 +333,6 @@ def feed(): result[i]["updated"] = row[5] result[i]["description"] = row[6] result[i]["link"] = row[8] - result[i]["private"] = row[9] return json.dumps(result) @@ -354,8 +352,6 @@ def project(projectid): result["updated"] = row[5] result["description"] = row[6] result["link"] = row[8] - result["private"] = row[9] - return json.dumps(result) row = query_db("SELECT * FROM projects WHERE id = ?;", get_db(), projectid, one=True) @@ -370,7 +366,6 @@ def project(projectid): result["updated"] = row[4] result["description"] = row[5] result["link"] = row[7] - result["private"] = row[8] else: result["errors"] = ["Permission denied"] return json.dumps(result) @@ -395,7 +390,6 @@ def project(projectid): project["updated"] = row[4] project["description"] = row[5] project["link"] = row[7] - project["private"] = row[8] result["errors"] = errors result["project"] = project diff --git a/schema.sql b/schema.sql index ed24865..501e05f 100644 --- a/schema.sql +++ b/schema.sql @@ -1,7 +1,7 @@ +DROP TABLE IF EXISTS posts; +DROP TABLE IF EXISTS follows; DROP TABLE IF EXISTS projects; DROP TABLE IF EXISTS users; -DROP TABLE IF EXISTS follows; -DROP TABLE IF EXISTS posts; CREATE TABLE users( id INTEGER, diff --git a/setup.py b/setup.py index 3e1eed9..6e9ecb3 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,6 @@ def db_update(username): tmp["description"] = repo["description"] tmp["website"] = repo["html_url"] tmp["link"] = repo["html_url"] - tmp["private"] = repo["private"] tmp["githubid"] = repo["id"] result_list.append(tmp) except: @@ -66,8 +65,8 @@ def update_insert(repos, userid): for repo in repos: if repo["githubid"] not in oldIDs[0]: - sql = f"INSERT INTO projects (userid, githubid ,name, created, updated, description, website, link, private) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?);" - query_db(sql, get_db(), userid, repo["githubid"], repo["name"], repo["created"], repo["updated"], repo["description"] ,repo["website"] ,repo["link"],repo["private"]) + sql = f"INSERT INTO projects (userid, githubid ,name, created, updated, description, website, link) VALUES(?, ?, ?, ?, ?, ?, ?, ?);" + query_db(sql, get_db(), userid, repo["githubid"], repo["name"], repo["created"], repo["updated"], repo["description"] ,repo["website"] ,repo["link"]) id = query_db("SELECT MAX(ID) FROM Projects", get_db(), one=True)[0]