[Answered ]-Tune queryset.get for working without DoesNotExist exception in model's Manager

2👍

Found solution here. There is self.model() inside Manager class:

class CurrentUserManager(models.Manager):
    ....
    def get(self, *args, **kwargs):
        try:
            object = super(CurrentUserManager, self).get(*args, **kwargs)
        except:
            object = self.model(**kwargs)
        return object

Leave a comment