Remove social connections page and restrict email settings to non-OAuth users
This commit is contained in:
parent
997fd760d2
commit
28f279a4ab
5 changed files with 13 additions and 69 deletions
|
|
@ -4,14 +4,23 @@
|
|||
|
||||
import os
|
||||
|
||||
from allauth.account.views import EmailView as AllauthEmailView
|
||||
from django.conf import settings
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.http import FileResponse, Http404
|
||||
from django.shortcuts import redirect
|
||||
from django.views.generic import ListView, View
|
||||
from photologue.models import Gallery, Photo, Video
|
||||
|
||||
|
||||
class EmailView(AllauthEmailView):
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
if request.user.is_authenticated and request.user.socialaccount_set.exists():
|
||||
return redirect("index")
|
||||
return super().dispatch(request, *args, **kwargs)
|
||||
|
||||
|
||||
class MediaAccess(View):
|
||||
def get(self, request, path):
|
||||
if not request.user.is_authenticated:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue