Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in activation-related try/except #5

Open
alexakarpov opened this issue Jan 19, 2022 · 0 comments
Open

error in activation-related try/except #5

alexakarpov opened this issue Jan 19, 2022 · 0 comments

Comments

@alexakarpov
Copy link

This is the block we have here in account/views.py:

    try:
        uid = force_text(urlsafe_base64_decode(uidb64))
        user = Customer.objects.get(pk=uid)
    except (TypeError, ValueError, OverflowError, user.DoesNotExist):
  

same block is present in pre-refactorin lectures, starting with Part 04, and up to including Part 10.

obviously, 'user', being a regular variable, doesn't have the DoesNotExist on it. If we replace the lower-case 'user' with, say, Customer (after we've created the class), the error goes away. Python being so dyamic and lenient is a double-edged sword )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant