From d269390c917fbb2cd0a3b3cdf887a86631e8172f Mon Sep 17 00:00:00 2001 From: Dominik Wombacher Date: Jan 23 2023 22:36:09 +0000 Subject: fix: 'NoneType' object has no attribute 'replace' Caused by changes how way 'StringField' is handling the default value in 'wtforms' >= 3.0.0. In previous versions, 'None' was changed to an empty string, now it stays 'None'. Logic added to set the affected variable to 'str()'. References: https://github.com/wtforms/wtforms/commit/29c60458f3809bb43fb4007cfe710f3d7f4067d4 https://github.com/wtforms/wtforms/issues/291 --- diff --git a/pagure/ui/repo.py b/pagure/ui/repo.py index b5a7c2b..c3c4b1d 100644 --- a/pagure/ui/repo.py +++ b/pagure/ui/repo.py @@ -2598,7 +2598,7 @@ def edit_file(repo, branchname, filename, username=None, namespace=None): branch=branchname, branchto=form.branch.data, filename=filename, - content=form.content.data, + content=form.content.data if form.content.data else str(), message="%s\n\n%s" % ( form.commit_title.data.strip(),