Utilize pylint como linter y corregi la mayoria de los errores
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import click
|
||||
import os
|
||||
import click
|
||||
|
||||
from flask import current_app
|
||||
from flask.cli import with_appcontext
|
||||
@@ -18,8 +18,8 @@ def generate_admin():
|
||||
username = current_app.config['USERNAME']
|
||||
password = current_app.config['PASSWORD']
|
||||
|
||||
u = User(username, generate_password_hash(password))
|
||||
db.session.add(u)
|
||||
user = User(username, generate_password_hash(password))
|
||||
db.session.add(user)
|
||||
db.session.commit()
|
||||
|
||||
|
||||
@@ -41,10 +41,14 @@ def add_files():
|
||||
default_file_type = FileType.query.filter_by(name='Default').first()
|
||||
added = 0
|
||||
|
||||
for f in existing_files:
|
||||
search = File.query.filter_by(filename=f).first()
|
||||
for existing_file in existing_files:
|
||||
search = File.query.filter_by(filename=existing_file).first()
|
||||
if search is None:
|
||||
file = File(f, 0, default_category.id, default_file_type.id)
|
||||
file = File(
|
||||
existing_file,
|
||||
0,
|
||||
default_category.id,
|
||||
default_file_type.id)
|
||||
db.session.add(file)
|
||||
added += 1
|
||||
db.session.commit()
|
||||
@@ -86,7 +90,7 @@ def add_files_command():
|
||||
Generates the rows in the database for the files currently uploaded
|
||||
They all will have default privacy, so, public
|
||||
"""
|
||||
added_size= add_files()
|
||||
added_size = add_files()
|
||||
click.echo(f'added {added_size} files')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user