0003-misc-inherit-from-authentic2_auh_saml-AppConfig-6973.patch
src/authentic2_auth_fedict/__init__.py | ||
---|---|---|
15 | 15 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | |
17 | 17 |
default_app_config = '%s.apps.AppConfig' % __name__ |
18 |
src/authentic2_auth_fedict/apps.py | ||
---|---|---|
16 | 16 | |
17 | 17 |
import json |
18 | 18 | |
19 |
import django.apps |
|
20 | 19 |
from django.contrib.auth.signals import user_logged_in |
21 | 20 |
from django.utils.translation import ugettext_lazy as _ |
22 | 21 | |
23 | 22 | |
24 |
class AppConfig(django.apps.AppConfig): |
|
23 |
from authentic2_auth_saml.apps import AppConfig |
|
24 | ||
25 | ||
26 |
class AppConfig(AppConfig): |
|
25 | 27 |
name = 'authentic2_auth_fedict' |
26 | 28 | |
27 | 29 |
def ready(self): |
28 |
from . import signals
|
|
30 |
super().ready()
|
|
29 | 31 | |
32 |
from . import signals |
|
30 | 33 |
user_logged_in.connect(signals.on_user_logged_in) |
31 | 34 | |
32 | 35 |
def a2_hook_event(self, name, **kwargs): |
... | ... | |
48 | 51 |
def get_authentication_backends(self): |
49 | 52 |
return ['authentic2_auth_fedict.backends.FedictBackend'] |
50 | 53 | |
51 |
def redirect_logout_list(self, request, next_url=None): |
|
52 |
from mellon.views import logout |
|
53 | ||
54 |
if 'mellon_session' in request.session: |
|
55 |
response = logout(request) |
|
56 |
if 'Location' in response: |
|
57 |
return [response['Location']] |
|
58 |
return [] |
|
59 | ||
60 | 54 |
def registration_form_prefill(self, request): |
61 | 55 |
if request.token.get('first_name'): |
62 | 56 |
return [ |
src/authentic2_auth_fedict/urls.py | ||
---|---|---|
19 | 19 |
from . import views |
20 | 20 | |
21 | 21 |
urlpatterns = [ |
22 |
url(r'^accounts/saml/', include('mellon.urls')), |
|
22 |
url(r'^accounts/saml/', include('mellon.urls'), kwargs={'logout_next_url': '/logout/'}),
|
|
23 | 23 |
url( |
24 | 24 |
r'^accounts/fedict/login/$', |
25 | 25 |
views.login, |
26 |
- |