Changeset - 30f4b245c065
[Not reviewed]
0 3 0
Christopher Neugebauer - 5 years ago 2017-08-18 16:39:54
chrisjrn@gmail.com
Removes the ability to login by username \o.
3 files changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
pinaxcon/account_hooks.py
Show inline comments
...
 
@@ -10,17 +10,16 @@ class BetterAccountHookSet(hooks.AccountDefaultHookSet):
 
        # Find an actual username so we can authenticate
 
        print username,
 
        if identifier_field == "email":
 
            username = self.get_username_by_email(username)
 
        print username,
 

	
 
        return {
 
            "username": username,
 
            "password": form.cleaned_data["password"],
 
        }
 

	
 
    def get_username_by_email(self, email):
 

	
 
        try:
 
            return User.objects.get(email=email).username
 
        except User.DoesNotExist:
 
            return None
pinaxcon/templates/account_login.html
Show inline comments
...
 
@@ -6,25 +6,25 @@
 
{% block head_title %}Log In{% endblock %}
 

	
 
{% block heading %}Log In or Sign Up{% endblock %}
 

	
 
{% block body_class %}login{% endblock %}
 

	
 
{% block content %}
 

	
 
  <div class="container">
 
    <div class="row">
 
      <div class="col-md-4">
 

	
 
        <form action="{% url 'nbpy_login_handle' %}" method="POST">
 
        <form action="{% url 'account_login' %}" method="POST">
 
          <div class="panel panel-primary">
 
            <div class="panel-heading">
 
              <h3 class="panel-title">
 
                Log into an existing account
 
              </h3>
 
            </div>
 
            <div class="panel-body">
 
              {% csrf_token %}
 
              {{ login_form|bootstrap }}
 
            </div>
 
            <div class="panel-footer">
 
              <button role="submit" class="btn btn-primary">Log In</button>
pinaxcon/urls.py
Show inline comments
...
 
@@ -44,25 +44,26 @@ urlpatterns = [
 
    url(r"^sponsors/prospectus$", RedirectView.as_view(url=_static("assets/northbaypython_prospectus.pdf")), name="sponsors/prospectus"),
 
    url(r"^northbaypython_prospectus.pdf$", RedirectView.as_view(url=_static("assets/northbaypython_prospectus.pdf")), name="northbaypython_prospectus.pdf"),
 
    url(r"^sponsors/become-a-sponsor$", TemplateView.as_view(template_name="static_pages/sponsors/become_a_sponsor.html"), name="sponsors/become-a-sponsor"),
 

	
 
    # news
 
    url(r"^news$", TemplateView.as_view(template_name="static_pages/news.html"), name="news"),
 

	
 
    # Django, Symposion, and Registrasion URLs
 

	
 
    url(r"^admin/", include(admin.site.urls)),
 

	
 
    url(r"^login$", views.account_login, name="nbpy_login"),
 
    url(r"^login_handle$", views.EmailLoginView.as_view(), name="nbpy_login_handle"),
 
    # Override the default account_login view with one that takes email addys
 
    url(r"^account/login/$", views.EmailLoginView.as_view(), name="account_login"),
 
    url(r"^account/", include("account.urls")),
 

	
 
    url(r"^dashboard/", symposion.views.dashboard, name="dashboard"),
 

	
 
    url(r"^speaker/", include("symposion.speakers.urls")),
 
    url(r"^proposals/", include("symposion.proposals.urls")),
 
    url(r"^sponsors/", include("symposion.sponsorship.urls")),
 
    url(r"^reviews/", include("symposion.reviews.urls")),
 
    url(r"^schedule/", include("symposion.schedule.urls")),
 

	
 
    url(r"^teams/", include("symposion.teams.urls")),
 

	
0 comments (0 inline, 0 general)