Commits

offline committed 742d442

more bugfixes

Comments (0)

Files changed (9)

 .*\.pyc
-django_auth.egg-info
+django_openauth.egg-info

openauth/admin.py

+from django.contrib import admin
+from openauth.models import Profile
+
+
+class ProfileAdmin(admin.ModelAdmin):
+    pass
+admin.site.register(Profile, ProfileAdmin)
+

openauth/settings.py

 MESSAGE_TYPE = get_config("MESSAGE_TYPE", "flash")
 CUSTOM_CONFIRMATION = get_config("CUSTOM_CONFIRMATION", None) # custom confirmation function
 REGISTRATION_ALLOWED = get_config("REGISTRATION_ALLOWED", True)
-REGISTRATION_FORM = get_config("REGISTRATION_FORM", "auth.forms.RegistrationForm")
+REGISTRATION_FORM = get_config("REGISTRATION_FORM", "openauth.forms.RegistrationForm")
 UNIQUE_USERNAME = get_config("UNIQUE_USERNAME", True)
 
 GRAVATAR_URL = get_config("GRAVATAR_URL", "http://www.gravatar.com/avatar.php?")

openauth/templates/openauth/mail/registration.txt

+{% load i18n %}{% blocktrans %}Registration on {{ domain }}{% endblocktrans %}
+{% blocktrans %}Thanks for registration on {{ domain }}{% endblocktrans %}.
+{% blocktrans %}Please use following link to activate your account: {{ url }}{% endblocktrans %}

openauth/templates/openauth/profile.html

+{% extends "base.html" %}
+{% block content %}
+{{ user.username }}
+{% endblock content %}

openauth/templates/openauth/registration.html

+{% extends 'base.html' %}
+{% block content %}
+<form action='.' method='post'>
+{{ form.as_table }}
+<input type='submit' value='submit' />
+</form>
+{% endblock %}

openauth/templates/openuath/mail/registration.txt

-{% load i18n %}{% blocktrans %}Registration on {{ domain }}{% endblocktrans %}
-{% blocktrans %}Thanks for registration on {{ domain }}{% endblocktrans %}.
-{% blocktrans %}Please use following link to activate your account: {{ url }}{% endblocktrans %}

openauth/templates/openuath/registration.html

-{% extends 'base.html' %}
-{% block content %}
-<form action='.' method='post'>
-{{ form.as_table }}
-<input type='submit' value='submit' />
-</form>
-{% endblock %}

openauth/views.py

 from django.contrib.auth.models import User
 from django.core.urlresolvers import reverse
 from django.contrib.auth.decorators import login_required
-from django.contrib.auth import login as proccess_login
+from django.contrib import auth 
 from django.shortcuts import get_object_or_404, redirect
 from django.utils.translation import ugettext as _
 from django.http import HttpResponseRedirect
 from openauth.models import Confirmation
 
 
-def message(request, msg, priority, redirect_name, args=None, kwargs=None):
+def message(request, msg, priority, redirect_name, args=[], kwargs={}):
     """
     Shortcut that prepare data for message view.
     """
     if openauth.settings.MESSAGE_TYPE == 'flash':
         request.flash[priority] = msg
-        return redirect(redirect_name, args=args, kwargs=kwargs)
+        return redirect(redirect_name, *args, **kwargs)
     return {'TEMPLATE': 'openauth/message.html', 'message': msg}
 
 
         user.save()
         if openauth.settings.ACTIVATION_AUTO_LOGIN:
             confirmation.user.backend = 'django.contrib.auth.backends.ModelBackend'
-            proccess_login(request, user)
+            auth.login(request, user)
 
         confirmation.delete()
         return message(request, _('Your account successfully activated'), 'success', 'show-user', args=[user.id])
     elif confiramtion_type == openauth.settings.PASSWORD_RESET_CONFIRMATION_TYPE:
         confirmation.user.backend = 'django.contrib.auth.backends.ModelBackend'                                                                                  
-        proccess_login(request, confirmation.user)      
+        auth.login(request, confirmation.user)      
         confirmation.delete()
         return message(request, _("Now you can change your password"), "notice", "openauth-reset-form")
     else:
 def logout(request):
     auth.logout(request)
     request.flash['notice'] = "You have been logged out"
-    return HttpResponseReload(request)
+    return redirect("index")
 
 
 @render_to('account/edit_user.html')