abhirajadhikary06 / abhirajadhikary06/openfeedback

[Bug] Refactor ```auth.py ``` to use SQLAlchemy ORM and fix Circular Imports.

未关闭
#36 1 条评论 0 个 reaction 已指派 1 人 已被 @Thedrogon 认领 在 GitHub 查看
apertre3.0 medium
主要语言
HTML
星标
8
派生
15
PR 合并指标
30 天内没有已合并 PR

描述

Currently, the application mixes two different methods of database access:

```app.py``` uses **Flask-SQLAlchemy.**

```auth.py``` uses raw sqlite3 connections.

Problems this causes:

Database Locking: Mixing raw connections with ORM sessions on SQLite can lead to "database is locked" errors and potential corruption.

Maintenance: We are defining the User schema in multiple places (SQL definitions in auth.py vs Model definitions in app.py).

Security: Raw SQL queries are more prone to errors than ORM queries.

@abhirajadhikary06

well I already have solution for this problem , would love to initiate.

贡献指南

打开贡献指南

调研方向

The issue points to auth.py and app.py. Start by examining the current raw SQLite3 connections in auth.py and the Flask-SQLAlchemy setup in app.py. Understand the User model definition in app.py and refactor auth.py to use the same SQLAlchemy ORM session. Ensure you resolve any circular import issues between these modules. Test the authentication flow after changes to confirm no database locking errors occur.

由索引模型根据 Issue 内容生成。

评估

技术栈
flask, python, sqlalchemy
领域
backend, database
Issue 类型
重构
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
40/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。