-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed url bug * Blacked
- Loading branch information
Showing
6 changed files
with
59 additions
and
56 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
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,32 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
|
||
# ============================================================================== | ||
# | ||
# File Name : letsagree/helpers.py | ||
# | ||
# Creation Date : Tue 18 Aug 2020 10:56:37 AM EEST (10:56) | ||
# | ||
# Last Modified : Tue 18 Aug 2020 11:24:24 AM EEST (11:24) | ||
# | ||
# ============================================================================== | ||
from django.conf import settings | ||
from django.urls import reverse, NoReverseMatch | ||
|
||
|
||
def get_named_url(): | ||
app_name = getattr(settings, "LETSAGREE_LOGOUT_APP_NAME", False) | ||
logout_named_url = getattr(settings, "LETSAGREE_LOGOUT_URL", "admin:logout") | ||
|
||
if app_name: | ||
return "{0}:logout".format(app_name) | ||
else: | ||
return logout_named_url | ||
|
||
|
||
def get_logout_url(): | ||
try: | ||
return reverse(get_named_url()) | ||
except NoReverseMatch: | ||
return "" |
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
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