Pluralize list operations ending in y correctly

This commit is contained in:
Matt Nawara 2020-07-31 10:38:09 -04:00
parent 559088463b
commit e135ea88ba

View File

@ -241,7 +241,10 @@ class AutoSchema(ViewInspector):
name = name[:-len(action)] name = name[:-len(action)]
if action == 'list' and not name.endswith('s'): # listThings instead of listThing if action == 'list' and not name.endswith('s'): # listThings instead of listThing
name += 's' if name.endswith('y'):
name = name[:-1] + 'ies'
else:
name += 's'
return name return name