mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
allauth working and integrated
This commit is contained in:
@@ -9,7 +9,11 @@ class AllAuthCustomAdapter(DefaultAccountAdapter):
|
||||
"""
|
||||
Whether to allow sign ups.
|
||||
"""
|
||||
allow_signups = super(
|
||||
AllAuthCustomAdapter, self).is_open_for_signup(request)
|
||||
# Override with setting, otherwise default to super.
|
||||
return getattr(settings, 'ACCOUNT_ALLOW_SIGNUPS', allow_signups)
|
||||
if request.resolver_match.view_name == 'account_signup':
|
||||
return False
|
||||
else:
|
||||
return super(AllAuthCustomAdapter, self).is_open_for_signup(request)
|
||||
|
||||
# disable password reset for now
|
||||
def send_mail(self, template_prefix, email, context):
|
||||
pass
|
||||
|
||||
@@ -119,7 +119,7 @@ def group_required(*groups_required):
|
||||
def in_groups(u):
|
||||
return has_group_permission(u, groups_required)
|
||||
|
||||
return user_passes_test(in_groups)
|
||||
return user_passes_test(in_groups, login_url='view_no_group')
|
||||
|
||||
|
||||
class GroupRequiredMixin(object):
|
||||
@@ -138,8 +138,7 @@ class GroupRequiredMixin(object):
|
||||
)
|
||||
return HttpResponseRedirect(reverse_lazy('index'))
|
||||
|
||||
return super(GroupRequiredMixin, self) \
|
||||
.dispatch(request, *args, **kwargs)
|
||||
return super(GroupRequiredMixin, self).dispatch(request, *args, **kwargs)
|
||||
|
||||
|
||||
class OwnerRequiredMixin(object):
|
||||
|
||||
Reference in New Issue
Block a user