JourneyJoker/partners/mixins.py

12 lines
339 B
Python
Raw Normal View History

from localauth.mixins import UserPassesTestMixin
class PartnerProfileRequiredMixin(UserPassesTestMixin):
def test_func(self):
try:
assert self.request.user.partnerprofile
return True
except:
return False
def get_login_url(self):
return reverse_lazy("partners:register")