diff --git a/bugheist/settings.py b/bugheist/settings.py index 93fc3cca6..f6450ed36 100644 --- a/bugheist/settings.py +++ b/bugheist/settings.py @@ -26,6 +26,7 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True +TESTING = False SITE_ID = 1 # Application definition @@ -146,3 +147,4 @@ # https://warehouse.python.org/project/whitenoise/ STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage' +LOGIN_REDIRECT_URL = "/" \ No newline at end of file diff --git a/bugheist/urls.py b/bugheist/urls.py index 9d6a2a918..faeb28e94 100644 --- a/bugheist/urls.py +++ b/bugheist/urls.py @@ -11,8 +11,8 @@ url(r'^$', website.views.index, name='index'), url(r'^admin/', include(admin.site.urls)), url(r'^issue/', login_required(IssueCreate.as_view()), name="issue"), - url(r'^accounts/profile/(?P[^/]+)/$', UserProfileDetailView.as_view(), name="profile"), + url(r'^profile/(?P[^/]+)/$', UserProfileDetailView.as_view(), name="profile"), url(r'^accounts/profile/', website.views.profile), url(r'^accounts/', include('allauth.urls')), - url('^activity/', include('actstream.urls')), + url(r'^activity/', include('actstream.urls')), ] diff --git a/website/models.py b/website/models.py index ae99ce84e..5c16536a6 100644 --- a/website/models.py +++ b/website/models.py @@ -1,5 +1,9 @@ from django.db import models from django.contrib.auth.models import User +from django.conf import settings +from allauth.account.signals import user_signed_up, user_logged_in +from actstream import action +from django.dispatch import receiver class Issue(models.Model): user = models.ForeignKey(User) @@ -8,3 +12,9 @@ class Issue(models.Model): screenshot = models.ImageField(null=True, blank=True) created = models.DateTimeField(auto_now_add=True) modified = models.DateTimeField(auto_now=True) + + +@receiver(user_logged_in, dispatch_uid="some.unique.string.id.for.allauth.user_logged_in") +def user_logged_in_(request, user, **kwargs): + if not settings.TESTING: + action.send(user, verb='logged in') diff --git a/website/templates/index.html b/website/templates/index.html index 7978f0408..0dd8240ef 100644 --- a/website/templates/index.html +++ b/website/templates/index.html @@ -54,7 +54,7 @@ {% if user.is_authenticated %}