Don’t return UUID objects from the UUID convertor

Because it means you often have to cast to string in your application
code just to get your tests passing.

The method being monkey patched is originally defined here: b81aa0f18c/src/werkzeug/routing.py (L1272)
This commit is contained in:
Chris Hill-Scott
2019-11-04 12:20:09 +00:00
parent 21a59598b2
commit 554a852e2d
7 changed files with 8 additions and 6 deletions

View File

@@ -234,7 +234,7 @@ class User(JSONModel, UserMixin):
]
def belongs_to_service(self, service_id):
return str(service_id) in self.service_ids
return service_id in self.service_ids
def belongs_to_service_or_403(self, service_id):
if not self.belongs_to_service(service_id):