You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2023/02/07 17:00:33 UTC
[allura] 02/08: [#8495] fix DeprecationWarning '_from_python'
This is an automated email from the ASF dual-hosted git repository.
brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git
commit 6f264bfba29a812b644363e2d7bd09b309b063f6
Author: Dillon Walls <di...@slashdotmedia.com>
AuthorDate: Wed Jan 25 15:03:09 2023 +0000
[#8495] fix DeprecationWarning '_from_python'
---
Allura/allura/lib/helpers.py | 2 +-
Allura/allura/lib/validators.py | 2 +-
Allura/allura/lib/widgets/discuss.py | 2 +-
Allura/allura/lib/widgets/form_fields.py | 4 ++--
ForgeDiscussion/forgediscussion/import_support.py | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
index cf25ec8d0..721cf0d41 100644
--- a/Allura/allura/lib/helpers.py
+++ b/Allura/allura/lib/helpers.py
@@ -533,7 +533,7 @@ class DateTimeConverter(FancyValidator):
else:
raise
- def _from_python(self, value, state):
+ def _convert_from_python(self, value, state):
return value.isoformat()
diff --git a/Allura/allura/lib/validators.py b/Allura/allura/lib/validators.py
index 0ce0f7c90..8d1d498f4 100644
--- a/Allura/allura/lib/validators.py
+++ b/Allura/allura/lib/validators.py
@@ -116,7 +116,7 @@ class Ming(fev.FancyValidator):
pass
return result
- def _from_python(self, value, state):
+ def _convert_from_python(self, value, state):
if isinstance(value, ObjectId):
return value
else:
diff --git a/Allura/allura/lib/widgets/discuss.py b/Allura/allura/lib/widgets/discuss.py
index 41b18fede..db5cf0ac4 100644
--- a/Allura/allura/lib/widgets/discuss.py
+++ b/Allura/allura/lib/widgets/discuss.py
@@ -36,7 +36,7 @@ class NullValidator(fev.FancyValidator):
def _convert_to_python(self, value, state):
return value
- def _from_python(self, value, state):
+ def _convert_from_python(self, value, state):
return value
# Discussion forms
diff --git a/Allura/allura/lib/widgets/form_fields.py b/Allura/allura/lib/widgets/form_fields.py
index 844a09018..0a510d551 100644
--- a/Allura/allura/lib/widgets/form_fields.py
+++ b/Allura/allura/lib/widgets/form_fields.py
@@ -50,9 +50,9 @@ class LabelList(v.UnicodeString):
value = super()._convert_to_python(value, state)
return value.split(',')
- def _from_python(self, value, state):
+ def _convert_from_python(self, value, state):
value = ','.join(value)
- value = super()._from_python(value, state)
+ value = super()._convert_from_python(value, state)
return value
diff --git a/ForgeDiscussion/forgediscussion/import_support.py b/ForgeDiscussion/forgediscussion/import_support.py
index af1842032..fcc61d91a 100644
--- a/ForgeDiscussion/forgediscussion/import_support.py
+++ b/ForgeDiscussion/forgediscussion/import_support.py
@@ -133,7 +133,7 @@ class AlluraUser(S.FancySchemaItem):
self.mapping[value] = sf_username
return result
- def _from_python(self, value, state):
+ def _convert_from_python(self, value, state):
return value.username