Skip to content

Commit

Permalink
resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
megabogus committed Feb 5, 2016
2 parents 391dde5 + 2027dfa commit 6248cea
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Spicy docs
==========

OLD version 1.0.0 for LookinHotels and other

Main and the one using case:

.. code-block:: sh
Expand Down
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ def long_description():
'uwsgi',

# spicy.scripts.py: deploy
<<<<<<< local
'configparser==3.3.0.post2',
=======
# 'configparser==3.3.0r2',
'configparser',
>>>>>>> other
'Jinja2==2.6',

# ?? siteskin deps.
Expand Down
4 changes: 2 additions & 2 deletions src/spicy/core/profile/auth_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class CustomUserModelBackend(ModelBackend):
def authenticate(self, username=None, password=None):
user_model = self.get_user_model()
if '@' in username:
kwargs = {'email': username}
kwargs = {'email__iexact': username}
else:
kwargs = {'username': username}
kwargs = {'username__iexact': username}
kwargs['is_banned'] = False

try:
Expand Down
10 changes: 10 additions & 0 deletions src/spicy/core/profile/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,20 @@
from django.utils.translation import ugettext_lazy as _
from spicy.utils.html import make_slug

<<<<<<< local
=======

>>>>>>> other
ACCOUNT_ALLOWED_CHARS = 'abcdefghjkmnpqrstuvwxyz'\
<<<<<<< local
'ABCDEFGHJKLMNPQRSTUVWXYZ'\
'23456789'
ACCOUNT_CHARS_LENGTH = getattr(
settings, 'ACCOUNT_CHARS_LENGTH', 10)
=======
'ABCDEFGHJKLMNPQRSTUVWXYZ'\
'23456789'
>>>>>>> other
ACCOUNT_ALLOWED_CHARS = getattr(
settings, 'ACCOUNT_ALLOWED_CHARS', ACCOUNT_ALLOWED_CHARS)
USERNAME_MAX_LENGTH = getattr(settings, 'USERNAME_MAX_LENGTH', 100)
Expand Down
2 changes: 1 addition & 1 deletion src/spicy/core/profile/locale/ru/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ msgstr "Срок действия ключа активации - %(expiration_d
#: templates/spicy.core.profile/mail/activation_email.html:23
#: templates/spicy.core.profile/mail/activation_email.txt:20
msgid "Thank you for registering on our site"
msgstr "Благодарим вам за регистрацию на нашем сайте"
msgstr "Благодарим ваc за регистрацию на нашем сайте"

#: templates/spicy.core.profile/mail/activation_email_subject.txt:1
#, python-format
Expand Down
8 changes: 8 additions & 0 deletions src/spicy/core/profile/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def export_data(self, columns):


class ProfileManager(UserManager):
<<<<<<< local
def make_random_password(self, length=defaults.ACCOUNT_CHARS_LENGTH,
=======
def get_query_set(self):
return ProfileQuerySet(self.model, using=self._db)

Expand Down Expand Up @@ -108,9 +111,14 @@ def import_data(self, src, fields):
return self.model.objects.filter(pk__in=ids)

def make_random_password(self, length=10,
>>>>>>> other
allowed_chars=defaults.ACCOUNT_ALLOWED_CHARS):
return get_random_string(length, allowed_chars)
<<<<<<< local

=======

>>>>>>> other
def activate_user(self, activation_key):
if defaults.SHA1_RE.search(activation_key):
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% trans "Your account is not acivated yet. To activate press the following link:" %}

http://{{ realhost }}{% url profile:public:activate user_id key %}?next={{ next_url }}
http://{{ realhost|default_if_none:site.domain }}{% url profile:public:activate user_id key %}?next={{ next_url }}

{% trans "If you're unable to follow the link in this mail, just copy it to your browser's address bar." %}

Expand Down
17 changes: 17 additions & 0 deletions src/spicy/core/simplepages/listeners.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
<<<<<<< local
import os


=======
>>>>>>> other
def reload_server(sender, instance, signal, **kwargs):
<<<<<<< local
try:
import uwsgi
uwsgi.reload()
except ImportError:
try:
os.utime(__file__, None)
except:
pass
=======
from spicy.utils import reload_server
reload_server()
>>>>>>> other
3 changes: 2 additions & 1 deletion src/spicy/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
__import__('pkg_resources').declare_namespace(__name__)

from .dynamic_import import *
from .email import *
from .filters import *
from .html import *
from .dynamic_import import *
from .models import *
from .permissions import *
from .printing import *
Expand Down
15 changes: 15 additions & 0 deletions src/spicy/utils/email.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
__all__ = 'process_email',


def process_email(text, sender, kind):
from django.conf import settings
name = ':'.join((sender.__class__.__name__.lower(), kind))
from spicy.utils import load_module
for processor_path in getattr(
settings, 'EMAIL_PROCESSORS', {}).get(name, ()):
processor = load_module(processor_path)
new_text = processor.get_text(text, sender=sender, kind=kind)
if new_text:
text = new_text

return text
4 changes: 4 additions & 0 deletions src/spicy/utils/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
from spicy.core.admin.conf import app_modules_register


<<<<<<< local
def find_templates(base_dir, name_tuples=True, rel_path=False):
=======
def find_templates(
base_dir, name_tuples=True, abs_path=None, rel_path=False,
from_dict=None):
if abs_path is None:
abs_path = not name_tuples
>>>>>>> other
templates = []

from spicy.core.siteskin.utils import get_siteskin_settings
Expand Down

0 comments on commit 6248cea

Please sign in to comment.