SomethingGeneric / flaskpress

Wordpress but it's actually Python + Flask
GNU General Public License v3.0
0 stars 0 forks source link

Sweep: Address sign in error involving the SQL functions #65

Open SomethingGeneric opened 1 year ago

SomethingGeneric commented 1 year ago

Details

Details

When registration is attempted through the endpoint on line 62 of main.py, SQAlchemy throws an error becauase the database hasn't been set up for users.

More of the error message:

sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: user
[SQL: SELECT user.id AS user_id, user.username AS user_username, user.password AS user_password 
FROM user 
WHERE user.username = ?
 LIMIT ? OFFSET ?]
[parameters: ('foo', 1, 0)]
(Background on this error at: https://sqlalche.me/e/20/e3q8)

Possibly helpful: https://docs.sqlalchemy.org/en/20/errors.html#error-e3q8

The error might also be related to the implementation of the UserMixin?

class User(UserMixin, db.Model):
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(30), unique=True)
    password = db.Column(db.String(30))

The line that specifically triggers the error is user = User.query.filter_by(username=username).first()

sweep-ai[bot] commented 1 year ago

0%


❌ Unable to Complete PR

It looks like an issue has occurred around fetching the files. Perhaps the repo has not been initialized. If this error persists contact team@sweep.dev.

@SomethingGeneric, please edit the issue description to include more details and I will automatically relaunch.

For bonus GPT-4 tickets, please report this bug on Discord.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description.