mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
/dev/api: Use "fullname" instead of "id" where appropriate.
ID is used elsewhere to mean the raw numerical ID (usually represented in decimal) rather than the fullname which includes the type ID and is in base36.
This commit is contained in:
@@ -617,6 +617,7 @@ class VByName(Validator):
|
||||
# Limit param only applies when multiple is True
|
||||
if not multiple and limit is not None:
|
||||
raise TypeError('multiple must be True when limit is set')
|
||||
self.thing_cls = thing_cls
|
||||
self.re = fullname_regex(thing_cls)
|
||||
self.multiple = multiple
|
||||
self.limit = limit
|
||||
@@ -653,8 +654,9 @@ class VByName(Validator):
|
||||
return self.set_error(self._error)
|
||||
|
||||
def param_docs(self):
|
||||
thingtype = (self.thing_cls or Thing).__name__.lower()
|
||||
return {
|
||||
self.param: 'an existing thing id',
|
||||
self.param: "fullname of a %s" % thingtype,
|
||||
}
|
||||
|
||||
class VByNameIfAuthor(VByName):
|
||||
@@ -897,7 +899,7 @@ class VSubmitParent(VByName):
|
||||
|
||||
def param_docs(self):
|
||||
return {
|
||||
self.param[0]: 'id of a parent thing',
|
||||
self.param[0]: "fullname of parent thing",
|
||||
}
|
||||
|
||||
class VSubmitSR(Validator):
|
||||
|
||||
Reference in New Issue
Block a user