-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UI to activate login with eventyay ticket (#139)
* Add UI to activate login with eventyay ticket * update format for logging
- Loading branch information
Showing
11 changed files
with
204 additions
and
35 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
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,22 @@ | ||
from allauth.socialaccount.models import SocialApp | ||
from django import forms | ||
from django.conf import settings | ||
from django.contrib.sites.models import Site | ||
|
||
|
||
class SSOClientForm(forms.ModelForm): | ||
def __init__(self, provider_id, *args, **kwargs): | ||
social_app = SocialApp.objects.filter(provider=provider_id).first() | ||
kwargs["instance"] = social_app | ||
super().__init__(*args, **kwargs) | ||
self.fields['secret'].required = True # Secret is required | ||
|
||
class Meta: | ||
model = SocialApp | ||
fields = ["client_id", "secret"] | ||
|
||
def save(self, organiser=None): | ||
self.instance.name = organiser | ||
self.instance.provider = organiser | ||
super().save() | ||
self.instance.sites.add(Site.objects.get(pk=settings.SITE_ID)) |
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
27 changes: 27 additions & 0 deletions
27
src/pretalx/orga/templates/orga/organiser/organiser_sso.html
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,27 @@ | ||
{% load bootstrap4 %} | ||
{% load i18n %} | ||
{% load rules %} | ||
|
||
{% block content %} | ||
<form method="post"> | ||
<fieldset> | ||
<legend>{% translate "SSO with Eventyay-ticket" %}</legend> | ||
{% csrf_token %} | ||
{% bootstrap_field sso_client_form.client_id layout='event' %} | ||
{% bootstrap_field sso_client_form.secret layout='event' %} | ||
<div class="submit-group panel"> | ||
<span></span> | ||
<span> | ||
<button type="submit" class="btn btn-success" name="form" value="sso_client"> | ||
<i class="fa fa-check"></i> | ||
{% translate "Save" %} | ||
</button> | ||
<button type="submit" class="btn btn-danger" name="form" value="remove_sso_client"> | ||
<i class="fa fa-check"></i> | ||
{% translate "Remove key" %} | ||
</button> | ||
</span> | ||
</div> | ||
</fieldset> | ||
</form> | ||
{% endblock %} |
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
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