Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rcamp/accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class Meta:
full_name = ldap_fields.CharField(db_column='cn')
email = ldap_fields.CharField(db_column='mail')
# posixAccount
username = ldap_fields.CharField(db_column='uid', primary_key=True)
username = ldap_fields.CharField(db_column='uid')
# ldap specific
modified_date = ldap_fields.DateTimeField(db_column='modifytimestamp',blank=True)

Expand Down
4 changes: 4 additions & 0 deletions rcamp/rcamp/settings/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
hosts = os.environ.get('RCAMP_ALLOWEDHOSTS')
ALLOWED_HOSTS = hosts.split(',')

CSRF_TRUSTED_ORIGINS = [
"https://rcamp.rc.colorado.edu",
]

INSTALLED_APPS = [
'django.contrib.admin',
Expand Down Expand Up @@ -71,6 +74,7 @@


LOGIN_REDIRECT_URL = '/'
LOGOUT_REDIRECT_URL = "/login"

# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/
Expand Down
7 changes: 6 additions & 1 deletion rcamp/rcamp/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@
{% if request.user.is_authenticated %}
<li><a href="/admin">Admin</a></li>
{% endif %}
<li><a href="/logout">Logout</a></li>
<li>
<form method="post" action="{% url 'logout' %}" style="display:inline;">
{% csrf_token %}
<button type="submit" class="btn btn-link p-0 align-baseline">Log out</button>
</form>
</li>
</ul>
</li>
{% else %}
Expand Down
2 changes: 1 addition & 1 deletion rcamp/rcamp/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
re_path(r'^grappelli/', include('grappelli.urls')), # grappelli URLS
re_path(r'^$', index_view, name='index'),
re_path(r'^login', auth_views.LoginView.as_view(template_name='registration/login.html')),
re_path(r'^logout', auth_views.LogoutView.as_view(template_name='registration/logout.html')),
re_path(r'^logout', auth_views.LogoutView.as_view(template_name='registration/logout.html'), name='logout'),
re_path(r'^admin/', admin.site.urls),
re_path(r'^api/', include('endpoints.urls')),
re_path(r'^accounts/', include(('accounts.urls', 'accounts'), namespace='accounts')),
Expand Down
Loading