You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the view serving my domain root in HUNGER_ALWAYS_ALLOW_VIEWS. For non-beta users I'd like to display a landing page.
I could'nt find a obvious way to do this using django-hunger, so I decided to write a simple function that checks if the user is in beta that is called in the template.
def is_in_beta(self):
from hunger.models import Invitation
if not self.is_authenticated():
return False
if self.is_staff or self.is_superuser:
return True
return Invitation.objects.filter(user=self, invited__isnull=False).exists()
Will this suffice? If yes, It'd nice to have the function in hunger.utils or somewhere else.
The text was updated successfully, but these errors were encountered:
I have the view serving my domain root in
HUNGER_ALWAYS_ALLOW_VIEWS
. For non-beta users I'd like to display a landing page.I could'nt find a obvious way to do this using django-hunger, so I decided to write a simple function that checks if the user is in beta that is called in the template.
Will this suffice? If yes, It'd nice to have the function in hunger.utils or somewhere else.
The text was updated successfully, but these errors were encountered: