base: allow sorting endpoints with None attribute (#38923)

This commit is contained in:
Emmanuel Cazenave 2020-01-09 18:05:03 +01:00
parent c575985fd2
commit 1067158843
1 changed files with 1 additions and 1 deletions

View File

@ -246,7 +246,7 @@ class BaseResource(models.Model):
endpoint_info = copy.copy(method.endpoint_info)
endpoint_info.http_method = http_method
endpoints.append(endpoint_info)
endpoints.sort(key=lambda x: (x.name, x.pattern))
endpoints.sort(key=lambda x: (x.name or '', x.pattern or ''))
return endpoints
def get_connector_permissions(self):