Skip to content

Commit

Permalink
remove stracks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivo van der Wijk committed Apr 4, 2015
1 parent 1d26ab2 commit 91d3680
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 78 deletions.
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ git+git://github.com/iivvoo/twotest
south
django-taggit==0.11.2
django-tinymce
stracks-api==0.2dev
Pillow
git+git://github.com/iivvoo/two.bootstrap
git+git://github.com/iivvoo/django_granules
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ envlist =
py27-1.4,
py27-1.5,
py27-1.6,
py27-1.7
# py27-1.7


[testenv]
Expand Down
30 changes: 1 addition & 29 deletions wheelcms_axle/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
from .base import WheelView, context
from .utils import applyrequest, json

import stracks


from wheelcms_axle import context_processors

def resolve_path(p):
Expand Down Expand Up @@ -391,11 +388,6 @@ def view(self):
if ctx:
self.context.update(ctx(self, self.request, self.instance))

stracks.content(spoke.instance.id,
name=spoke.instance.title
).log("? (%s) viewed by ?" % spoke.title,
stracks.user(self.user()),
action=stracks.view())
return self.template(spoke.view_template())
elif self.instance.primary_content():
""" attached but untranslated """
Expand Down Expand Up @@ -488,10 +480,6 @@ def create(self, type=None, attach=False, *a, **b):
## force reindex
typeinfo.model.objects.get(pk=p.pk).save()

ent = stracks.content(p.id, name=p.title)
ent.log("? (%s) created by ?" % typeinfo.title,
stracks.user(self.user()), action=stracks.create())

return self.redirect(target.get_absolute_url(),
success='"%s" created' % p.title)
except OSError, e:
Expand Down Expand Up @@ -602,9 +590,6 @@ def edit(self):
if slug and slug != self.instance.slug(language=content_language):
self.instance.rename(slug, language=content_language)

e = stracks.content(content.id, name=content.title)
e.log("? (%s) updated by ?" % content.spoke().title,
stracks.user(self.user()), action=stracks.edit())
return self.redirect(instance.get_absolute_url(),
success="Updated")
else:
Expand Down Expand Up @@ -850,24 +835,11 @@ def handle_contents_actions_delete(self):
n = Node.objects.get(tree_path=p)
## XXX recursively delete, or not, or detach...
if n:
content = n.content()
if content:
stracks.content(content.id,
name=content.title
).log("? (%s) removed by ?" %
content.spoke().title,
stracks.user(self.user()),
action=stracks.delete())
else:
stracks.user(self.user()).log("Unattached node removed: "
+ n.get_absolute_url(),
action=stracks.delete());

try:
n.parent().remove(n.slug())
except NodeNotFound:
## should not happen but if it does, bag it and tag it
stracks.content(content.id, name=content.title).exception()
pass

n.delete()
count += 1
Expand Down
28 changes: 0 additions & 28 deletions wheelcms_axle/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,12 @@ class Role(models.Model):
from userena.signals import signup_complete
from django.contrib.auth.signals import user_logged_in, user_logged_out

import stracks
## django 1.5
## from django.contrib.auth.signals import user_login_failed
##
## @receiver(user_login_failed)
## def log_failure(sender, credentials, **kwargs):
## """ Log the user logging out """
## stracksclient.warning("Authentication failed", data=credentials)
##

from django.db.utils import DatabaseError
import logging

@receiver(post_save, sender=User)
def log_create(sender, instance, created, **kwargs):
""" Log the creation of a new user """
if created:
stracks.user(instance).log("? has been created")
## make sure it has a wheel profile
try:
WheelProfile.objects.get_or_create(user=instance)
Expand All @@ -136,22 +124,6 @@ def create_profiles(app, **kwargs):
for u in User.objects.all():
WheelProfile.objects.get_or_create(user=u)

@receiver(signup_complete, dispatch_uid='stracks.log_signup')
def log_signup(sender, signal, user, **kwargs):
""" Log the creation of a new user """
stracks.user(user).log("? has completed (userena) signup")


@receiver(user_logged_in, dispatch_uid='stracks.log_signin')
def log_login(sender, request, user, **kwargs):
""" Log the user logging in """
stracks.user(user).log("? has logged in", action=stracks.login())

@receiver(user_logged_out, dispatch_uid='stracks.log_signout')
def log_logout(sender, request, user, **kwargs):
""" Log the user logging out """
stracks.user(user).log("? has logged out", action=stracks.logout())

@receiver(post_save, dispatch_uid="wheelcms_axle.spoke.assign_perms")
def assign_perms(sender, instance, created, **kwargs):

Expand Down
19 changes: 0 additions & 19 deletions wheelcms_axle/stracks.py

This file was deleted.

0 comments on commit 91d3680

Please sign in to comment.