-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from samarsajad/book2
News displayed on home page
- Loading branch information
Showing
12 changed files
with
2,900 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
|
||
from functools import wraps | ||
from django.shortcuts import redirect | ||
from django.urls import reverse | ||
|
||
def custom_login_required(view_func): | ||
@wraps(view_func) | ||
def _wrapped_view(request, *args, **kwargs): | ||
if not request.user.is_authenticated: | ||
return redirect(reverse('core:index')) | ||
return view_func(request, *args, **kwargs) | ||
return _wrapped_view |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.