Fixed no-cls-argument on staticmethod __new__ (#6960)

This commit is contained in:
mehrab 2019-10-04 23:10:09 +03:30 committed by Ryan P Kilby
parent 30e56f62ba
commit b4db2dfacf
2 changed files with 4 additions and 4 deletions

View File

@ -1764,8 +1764,8 @@ class JSONField(Field):
# When HTML form input is used, mark up the input
# as being a JSON string, rather than a JSON primitive.
class JSONString(str):
def __new__(self, value):
ret = str.__new__(self, value)
def __new__(cls, value):
ret = str.__new__(cls, value)
ret.is_json_string = True
return ret
return JSONString(dictionary[self.field_name])

View File

@ -46,8 +46,8 @@ class Hyperlink(str):
We use this for hyperlinked URLs that may render as a named link
in some contexts, or render as a plain URL in others.
"""
def __new__(self, url, obj):
ret = str.__new__(self, url)
def __new__(cls, url, obj):
ret = str.__new__(cls, url)
ret.obj = obj
return ret