from django_url_decr import url_decr
from django.contrib.auth.decorators import login_required
urlpatterns = [
url_decr(r'^profile/',
include('profile.urls'),
decr=login_required
)
]
def admin_redirect(user):
""" Checks if user is admin and don't let him open member area """
if user.is_staff:
return redirect('/')
@login_required
def mem_area(request):
""" Returns Member Area HTML with data """
user = request.user
redirect = admin_redirect(user)
if redirect:
return redirect
user_info = UserInfo.objects.get(user_id=user.id)
page_title = 'Dashboard'
return render(request, 'user_resume/member_area/member_area.html', locals())
.wrapper>.black+.red+.blue
.wrapper{position: relative;}
.blue{position:absolute}