Improve views query #29
                
     Open
            
            
          
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
passkey/views.py.django-passkeys/passkeys/views.py
Lines 15 to 19 in abb687b
I think there is a risk that Passkey ID on database will be leaked.
If you are checking user matches, I think it would be a good idea to retrieve it as a query and set it as Not Found.
django-passkeys/passkeys/views.py
Line 23 in abb687b
idis reserved as a built-in function.django-passkeys/passkeys/views.py
Lines 24 to 27 in abb687b
This code generates the query twice.
Also, here we only have one matching data, so we can improve it by using
first().django-passkeys/passkeys/views.py
Line 30 in abb687b
django.http.responseprovidesHttpResponseForbiddenand the status is set to 403.