0

I'm creating an instance of a Class like this :

def exists(username, password):
    try:
        user_doc =  User.objects(username=username,password=password).exclude('password')
    except DoesNotExist, e:
        raise e
    return user_doc._parse()

The try block raises this exception when there are no matching records.
But I get syntax error.

How should I catch this exception ?

Remi Guan
  • 21,506
  • 17
  • 64
  • 87
vivekanon
  • 1,813
  • 3
  • 22
  • 44

0 Answers0