fixed PUT on /positions/{position_id}/ API endpoint
This commit is contained in:
parent
d45bcfb2fb
commit
ff7d9d85fd
1 changed files with 2 additions and 2 deletions
|
@ -291,10 +291,10 @@ class UpdatePositionSchema(BaseSchema):
|
|||
response={200: AnyPositionStatusSchema, **API404.dict(), **auth_permission_responses})
|
||||
def set_position(request, position_id: AnyPositionID, update: UpdatePositionSchema):
|
||||
# todo: may an API key do this?
|
||||
if not update.position_id.startswith('p:'):
|
||||
if not isinstance(position_id, str) or not position_id.startswith('p:'):
|
||||
raise API404()
|
||||
try:
|
||||
location = Position.objects.get(secret=update.position_id[2:])
|
||||
location = Position.objects.get(secret=position_id[2:])
|
||||
except Position.DoesNotExist:
|
||||
raise API404()
|
||||
if location.owner != request.user:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue