diff --git a/verse/describer/describe_files.py b/verse/describer/describe_files.py index b8346c3..9760673 100644 --- a/verse/describer/describe_files.py +++ b/verse/describer/describe_files.py @@ -112,7 +112,6 @@ def get_distribusi_file_forms(distribusi_id): def save_described_file_to_db(describe_form, distribusi_file): try: if describe_form.description.data: - print(distribusi_file.id) distribusi_file.description = describe_form.description.data if describe_form.alttext.data: distribusi_file.alttext = describe_form.alttext.data diff --git a/verse/distribusikan/css_editor_page.py b/verse/distribusikan/css_editor_page.py index 8e9997e..85382f0 100644 --- a/verse/distribusikan/css_editor_page.py +++ b/verse/distribusikan/css_editor_page.py @@ -12,7 +12,7 @@ from sqlalchemy.exc import ( ) from werkzeug.utils import secure_filename -from app import db +from app import db, APP from distribusikan.distribusis_info import DistribusisInfo from distribusikan.forms.distribusiform import DistribusiForm from distribusikan.forms.editorform import EditorForm @@ -92,8 +92,7 @@ def copy_public_to_user_folder(editorform, publicfolder, newcssfolder): copycssfile = os.path.join( publicfolder, f"{secure_filename(editorform.cssname.data)}.css" ) - print(f"copying file: {copycssfile}") - print(f"to folder: {newcssfolder}") + APP.logger.info(f"copying file:{copycssfile} to folder:{newcssfolder}") shutil.copy(copycssfile, newcssfolder) diff --git a/verse/distribusikan/distribusi_selector.py b/verse/distribusikan/distribusi_selector.py index f7d9e53..9c01c95 100644 --- a/verse/distribusikan/distribusi_selector.py +++ b/verse/distribusikan/distribusi_selector.py @@ -10,7 +10,7 @@ from sqlalchemy.exc import ( InvalidRequestError, ) -from app import db +from app import db, APP from distribusikan.distribusis_info import DistribusisInfo from distribusikan.forms.distribusiform import DistribusiForm from distribusikan.forms.publicthemeform import PublicThemeForm @@ -66,7 +66,7 @@ def auto_fill_in_upload_form(uploadform, current_distribusi): def select_new_distribusi(): - print("make a new distribusi") + APP.logger.info("make a new distribusi") select_current_distribusi("new") @@ -80,12 +80,11 @@ def select_describe_distribusi(distribusiname): def select_update_distribusi(distribusiname): - print(f"Update this distribusi {distribusiname}") select_current_distribusi(distribusiname) def delete_distribusi(distribusiname): - print(f"delete this distribusi {distribusiname}") + APP.logger.info(f"attempt to delete distribusi:{distribusiname}") selectorform = SelectorForm() try: user = User.query.filter_by(email=current_user.email).first() @@ -95,13 +94,11 @@ def delete_distribusi(distribusiname): if distribusi.userid is user.id: db.session.delete(distribusi) db.session.commit() - # SelectField error is list is a tuple?? why?? - # selectorform.distribusis.errors.append("Distribusi deleted!") except (InvalidRequestError, DataError, InterfaceError, DatabaseError): db.session.rollback() - # selectorform.distribusis.errors.append("Unknown error occured!") flash("An error occured !", "danger") _delete_distribusi_files(distribusi.distribusiname) + APP.logger.info(f"deleted distribusi:{distribusiname}") return selectorform diff --git a/verse/statuspengguna/loginuser.py b/verse/statuspengguna/loginuser.py index ba28c72..fc48d29 100644 --- a/verse/statuspengguna/loginuser.py +++ b/verse/statuspengguna/loginuser.py @@ -39,7 +39,6 @@ def LoginUser(): flash("Logged in successfully.", "success") next = request.args.get("next") if next is not None and not is_safe_url(next): # noqa: F821 - print(next) return abort(400) print("index") return redirect(next or url_for("index"))