Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
UnboundLocalError: local variable 'got' referenced before assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
LetMeFly666 committed Oct 30, 2022
1 parent 239c21a commit c15a1f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions back/Apps/Functions/Card.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Author: LetMeFly
Date: 2022-10-28 18:04:22
LastEditors: LetMeFly
LastEditTime: 2022-10-30 20:45:39
LastEditTime: 2022-10-30 20:47:19
'''
from django.http import JsonResponse
from django.shortcuts import redirect
Expand Down Expand Up @@ -174,9 +174,9 @@ def share(request):
})
user.update(lastGot=0, shareNum=user.first().shareNum + 1)
newCard = models.Cards.objects.create(shareBy=username, cardIs=cardType, leetcodeURL=leetcodeURL)
got.update(shareCardID=newCard.cardID)
if parentID:
got = models.Got.objects.filter(gotCardID=parentID, gotBy=username)
got.update(shareCardID=newCard.cardID)
th = got.first().th
if th == 1:
models.Cards.objects.filter(cardID=parentID).update(get1=1)
Expand Down

0 comments on commit c15a1f5

Please sign in to comment.