Commits

vl...@vlad-Vostro-3500  committed df676be

fix bugs

  • Participants
  • Parent commits c767f70

Comments (0)

Files changed (5)

-application: ekkli-coop
+application: ekkli-maps
 version: 1
 runtime: python27
 api_version: 1

File invitation/backends.py

+from django.contrib.auth import authenticate, login
 from django.contrib.auth.models import User
 from django.contrib.sites.models import RequestSite
 from common.util import get_current_site
             signals.user_registered.send(sender=self.__class__,
                                              user=user,
                                              request=request)
+            user = authenticate(username=email, password=password)
+            login(request, user)
             return user

File maps/models.py

 from django.utils.translation import ugettext as _
 from datetime import datetime
 from registration import signals
+import logging
 
 
 def model_to_dict(model):
 
 
 def create_user_profile(user, request, **kwargs):
-    profile = UserProfile.objects.create(user=user)
 
     map_id = request.REQUEST.get('map_id', False)
     map = Map.objects.get(id = map_id)
-    profile.group_profile = map.group_profile
+    logging.info('ffffffffffffffff %s' % map.group_profile)
+    profile = UserProfile.objects.create(user=user,group_profile = map.group_profile)
     profile.save()
 
 signals.user_registered.connect(create_user_profile)
 
 SECRET_KEY = '=r-$b*8hglm+858&dns,dna,dmnas,dand,mnsa,d-&6-3d3vfc4((7yd0dbrakhvi'
 
-CURRENT_SITE = 'ekkli-coop.appspot.com/'
+CURRENT_SITE = 'ekkli-maps.appspot.com/'
 DEFAULT_FROM_EMAIL='voskoboynikvlad@googlemail.com'
 
 INSTALLED_APPS = (

File templates/admin/base.html

             <div id="branding">
                 {% block branding %}{% endblock %}
             </div>
-            {% if user.is_active and user.is_staff %}
+            {% if user.is_active %}
                 <div id="user-tools">
                     {% trans 'Welcome,' %}
                     <strong>{% filter force_escape %}{% firstof user.first_name user.username %}{% endfilter %}</strong>.