anderson-ufrj
commited on
Commit
·
e317c9e
1
Parent(s):
11f0acf
fix(models): rename metadata to meta_info in APIKey model
Browse filesFix SQLAlchemy InvalidRequestError by renaming the reserved
attribute name 'metadata' to 'meta_info' in the APIKey model
- src/models/api_key.py +2 -2
src/models/api_key.py
CHANGED
|
@@ -88,7 +88,7 @@ class APIKey(BaseModel):
|
|
| 88 |
last_error_at = Column(DateTime)
|
| 89 |
|
| 90 |
# Metadata
|
| 91 |
-
|
| 92 |
|
| 93 |
# Indexes for performance
|
| 94 |
__table_args__ = (
|
|
@@ -230,7 +230,7 @@ class APIKey(BaseModel):
|
|
| 230 |
"allowed_ips": self.allowed_ips,
|
| 231 |
"allowed_origins": self.allowed_origins,
|
| 232 |
"scopes": self.scopes,
|
| 233 |
-
"metadata": self.
|
| 234 |
})
|
| 235 |
|
| 236 |
return data
|
|
|
|
| 88 |
last_error_at = Column(DateTime)
|
| 89 |
|
| 90 |
# Metadata
|
| 91 |
+
meta_info = Column(JSON, default=dict)
|
| 92 |
|
| 93 |
# Indexes for performance
|
| 94 |
__table_args__ = (
|
|
|
|
| 230 |
"allowed_ips": self.allowed_ips,
|
| 231 |
"allowed_origins": self.allowed_origins,
|
| 232 |
"scopes": self.scopes,
|
| 233 |
+
"metadata": self.meta_info
|
| 234 |
})
|
| 235 |
|
| 236 |
return data
|