Commits

nik...@nikolas-H67MA-USB3-B3  committed dc6ee75

profile

  • Participants
  • Parent commits 7d92113

Comments (0)

Files changed (2)

File vk_iframe/backends.py

 from django.contrib.auth.backends import ModelBackend
 from django.contrib.auth.models import User
 from vk_iframe.models import City, Country
+from vk_iframe.signals import player_created
 
 
 class VkontakteUserBackend(ModelBackend):
                 first_name=vk_profile['first_name'],
                 last_name=vk_profile['last_name'],
             )
-
         user, created = User.objects.get_or_create(username=username, defaults=defaults)
         if created:
             profile = user.profile
             profile.soc_id = username
             profile.save()
+            player_created.send(sender=self, player=self)
             user = self.configure_user(vk_profile, user)
         return user
 

File vk_iframe/signals.py

+# -*- coding: utf-8 -*-
+__author__ = 'nikolas'
+import django.dispatch
+
+player_created = django.dispatch.Signal(providing_args=["player"])