Commit 2f0cb2ba authored by Michal Čihař's avatar Michal Čihař

Rename accounts application

parent ee379726
......@@ -31,8 +31,8 @@ script:
- ./manage.py validate --settings weblate.settings_test_$TRAVIS_DATABASE
- ./manage.py syncdb --noinput --settings weblate.settings_test_$TRAVIS_DATABASE
- ./manage.py migrate --settings weblate.settings_test_$TRAVIS_DATABASE --traceback
- coverage run --source=. ./manage.py test --settings weblate.settings_test_$TRAVIS_DATABASE trans lang accounts
- pep8 --exclude migrations accounts trans lang weblate
- pylint --reports=n --rcfile=pylint.rc trans accounts weblate lang
- coverage run --source=. ./manage.py test --settings weblate.settings_test_$TRAVIS_DATABASE trans lang weblate.accounts
- pep8 --exclude migrations trans lang weblate
- pylint --reports=n --rcfile=pylint.rc trans weblate lang
after_success:
- coveralls
......@@ -29,7 +29,7 @@ from django.conf import settings
from weblate import settings_example
from weblate import appsettings
from trans.util import HAS_LIBRAVATAR
from accounts.forms import HAS_ICU
from weblate.accounts.forms import HAS_ICU
import weblate
import django
......
......@@ -690,7 +690,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
Sends out notifications on merge failure.
'''
# Notify subscribed users about failure
from accounts.models import notify_merge_failure
from weblate.accounts.models import notify_merge_failure
notify_merge_failure(self, error, status)
def update_branch(self, request=None):
......
......@@ -595,7 +595,7 @@ class Translation(models.Model, URLMixin, PercentMixin):
# Notify subscribed users
if was_new:
from accounts.models import notify_new_string
from weblate.accounts.models import notify_new_string
notify_new_string(self)
@property
......
......@@ -497,7 +497,7 @@ class Unit(models.Model):
Optional user parameters defines authorship of a change.
'''
from accounts.models import (
from weblate.accounts.models import (
notify_new_translation, notify_new_contributor
)
from trans.models.changes import Change
......
......@@ -53,7 +53,7 @@ class SuggestionManager(models.Manager):
'''
Creates new suggestion for this unit.
'''
from accounts.models import notify_new_suggestion
from weblate.accounts.models import notify_new_suggestion
if not request.user.is_authenticated():
user = None
......@@ -208,7 +208,7 @@ class CommentManager(models.Manager):
'''
Adds comment to this unit.
'''
from accounts.models import notify_new_comment
from weblate.accounts.models import notify_new_comment
new_comment = Comment.objects.create(
user=user,
......
......@@ -30,7 +30,7 @@ from django.core import mail
from trans.models.changes import Change
from trans.models.unitdata import Suggestion
from trans.tests.test_models import RepoTestCase
from accounts.models import Profile
from weblate.accounts.models import Profile
from PIL import Image
import re
import time
......
......@@ -39,7 +39,7 @@ from trans.forms import (
get_upload_form, SearchForm,
AutoForm, ReviewForm, NewLanguageForm,
)
from accounts.models import Profile, notify_new_language
from weblate.accounts.models import Profile, notify_new_language
from trans.views.helper import (
get_project, get_subproject, get_translation,
try_set_language,
......
......@@ -19,7 +19,7 @@
#
from django.contrib import admin
from accounts.models import Profile, VerifiedEmail
from weblate.accounts.models import Profile, VerifiedEmail
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
......
......@@ -22,8 +22,8 @@ from django import forms
from django.utils.translation import ugettext_lazy as _, get_language
from django.contrib.auth.forms import AuthenticationForm
from accounts.models import Profile, VerifiedEmail
from accounts.captcha import MathCaptcha
from weblate.accounts.models import Profile, VerifiedEmail
from weblate.accounts.captcha import MathCaptcha
from lang.models import Language
from trans.models import Project
from django.contrib.auth.models import User
......
......@@ -20,7 +20,7 @@
from django.core.management.base import BaseCommand
from optparse import make_option
from accounts.models import create_groups, move_users
from weblate.accounts.models import create_groups, move_users
class Command(BaseCommand):
......
......@@ -24,7 +24,7 @@ from django.core.urlresolvers import reverse
from social.pipeline.partial import partial
from social.exceptions import AuthForbidden
from accounts.models import send_notification_email, VerifiedEmail
from weblate.accounts.models import send_notification_email, VerifiedEmail
from weblate import appsettings
......
......@@ -31,7 +31,7 @@ from django.conf import settings
from django.core.management import call_command
from django.http import HttpRequest, HttpResponseRedirect
from accounts.models import (
from weblate.accounts.models import (
Profile,
notify_merge_failure,
notify_new_string,
......@@ -41,8 +41,8 @@ from accounts.models import (
notify_new_contributor,
notify_new_language,
)
from accounts.captcha import hash_question, unhash_question, MathCaptcha
from accounts.middleware import RequireLoginMiddleware
from weblate.accounts.captcha import hash_question, unhash_question, MathCaptcha
from weblate.accounts.middleware import RequireLoginMiddleware
from trans.tests.test_views import ViewTestCase
from trans.tests.test_util import get_test_file
......
......@@ -20,7 +20,7 @@
from django.conf.urls import patterns, url, include
from accounts.views import RegistrationTemplateView
from weblate.accounts.views import RegistrationTemplateView
urlpatterns = patterns(
......@@ -32,12 +32,12 @@ urlpatterns = patterns(
),
name='email-sent'
),
url(r'^password/', 'accounts.views.password', name='password'),
url(r'^reset/', 'accounts.views.reset_password', name='password_reset'),
url(r'^logout/', 'accounts.views.weblate_logout', name='logout'),
url(r'^profile/', 'accounts.views.user_profile', name='profile'),
url(r'^login/$', 'accounts.views.weblate_login', name='login'),
url(r'^register/$', 'accounts.views.register', name='register'),
url(r'^email/$', 'accounts.views.email_login', name='email_login'),
url(r'^password/', 'weblate.accounts.views.password', name='password'),
url(r'^reset/', 'weblate.accounts.views.reset_password', name='password_reset'),
url(r'^logout/', 'weblate.accounts.views.weblate_logout', name='logout'),
url(r'^profile/', 'weblate.accounts.views.user_profile', name='profile'),
url(r'^login/$', 'weblate.accounts.views.weblate_login', name='login'),
url(r'^register/$', 'weblate.accounts.views.register', name='register'),
url(r'^email/$', 'weblate.accounts.views.email_login', name='email_login'),
url(r'', include('social.apps.django_app.urls', namespace='social')),
)
......@@ -31,7 +31,7 @@ from django.contrib.auth.views import login, logout
from django.views.generic import TemplateView
from urllib import urlencode
from accounts.forms import (
from weblate.accounts.forms import (
RegistrationForm, PasswordForm, PasswordChangeForm, EmailForm, ResetForm,
LoginForm, HostingForm, CaptchaRegistrationForm
)
......@@ -39,9 +39,9 @@ from social.backends.utils import load_backends
from social.apps.django_app.utils import BACKENDS
from social.apps.django_app.views import complete
from accounts.models import set_lang, Profile
from weblate.accounts.models import set_lang, Profile
from trans.models import Change, Project
from accounts.forms import (
from weblate.accounts.forms import (
ProfileForm, SubscriptionForm, UserForm, ContactForm
)
from weblate import appsettings
......
......@@ -171,7 +171,7 @@ AUTHENTICATION_BACKENDS = (
'social.backends.email.EmailAuth',
#'social.backends.github.GithubOAuth2',
#'social.backends.suse.OpenSUSEOpenId',
'accounts.auth.WeblateUserBackend',
'weblate.accounts.auth.WeblateUserBackend',
)
# Social auth backends setup
......@@ -187,18 +187,18 @@ SOCIAL_AUTH_PIPELINE = (
'social.pipeline.social_auth.associate_by_email',
'social.pipeline.social_auth.social_user',
'social.pipeline.user.get_username',
'accounts.pipeline.require_email',
'weblate.accounts.pipeline.require_email',
'social.pipeline.mail.mail_validation',
'social.pipeline.social_auth.associate_by_email',
'accounts.pipeline.verify_open',
'weblate.accounts.pipeline.verify_open',
'social.pipeline.user.create_user',
'social.pipeline.social_auth.associate_user',
'social.pipeline.social_auth.load_extra_data',
'social.pipeline.user.user_details',
'accounts.pipeline.store_email',
'weblate.accounts.pipeline.store_email',
)
SOCIAL_AUTH_EMAIL_VALIDATION_FUNCTION = 'accounts.pipeline.send_validation'
SOCIAL_AUTH_EMAIL_VALIDATION_FUNCTION = 'weblate.accounts.pipeline.send_validation'
SOCIAL_AUTH_EMAIL_VALIDATION_URL = '%s/accounts/email-sent/' % URL_PREFIX
SOCIAL_AUTH_LOGIN_ERROR_URL = '%s/accounts/login/' % URL_PREFIX
SOCIAL_AUTH_EMAIL_FORM_URL = '%s/accounts/email/' % URL_PREFIX
......@@ -213,7 +213,7 @@ MIDDLEWARE_CLASSES = (
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'social.apps.django_app.middleware.SocialAuthExceptionMiddleware',
'accounts.middleware.RequireLoginMiddleware',
'weblate.accounts.middleware.RequireLoginMiddleware',
)
ROOT_URLCONF = 'weblate.urls'
......@@ -240,7 +240,7 @@ INSTALLED_APPS = (
'south',
'trans',
'lang',
'accounts',
'weblate.accounts',
# Needed for javascript localization
'weblate',
)
......
......@@ -20,7 +20,7 @@
from django.contrib.sitemaps import GenericSitemap, Sitemap
from trans.models import Project, SubProject, Translation
from accounts.models import Profile
from weblate.accounts.models import Profile
project_dict = {
'queryset': Project.objects.all_acl(None),
......
......@@ -29,7 +29,7 @@ from trans.feeds import (
)
from trans.views.changes import ChangesView
from weblate.sitemaps import sitemaps
import accounts.urls
import weblate.accounts.urls
# URL regexp for language code
LANGUAGE = r'(?P<lang>[^/-]{2,3}([_-][A-Za-z]{2})?(@[a-z]+)?)'
......@@ -618,17 +618,17 @@ urlpatterns = patterns(
url(r'^admin/', include(admin.site.urls)),
# Auth
url(r'^accounts/', include(accounts.urls)),
url(r'^accounts/', include(weblate.accounts.urls)),
# Static pages
url(r'^contact/', 'accounts.views.contact', name='contact'),
url(r'^hosting/', 'accounts.views.hosting', name='hosting'),
url(r'^contact/', 'weblate.accounts.views.contact', name='contact'),
url(r'^hosting/', 'weblate.accounts.views.hosting', name='hosting'),
url(r'^about/$', 'trans.views.basic.about', name='about'),
# User pages
url(
r'^user/(?P<user>[^/]+)/',
'accounts.views.user_page',
'weblate.accounts.views.user_page',
name='user_page',
),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment