update req file and update directory structure

This commit is contained in:
Tomislav R 2016-03-07 19:19:25 +01:00
parent 5c6e0cf7c6
commit f82e0604ca
22 changed files with 11 additions and 7 deletions

View file

@ -120,6 +120,10 @@ TEMPLATES = [
'BACKEND': 'django.template.backends.django.DjangoTemplates', 'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [ 'DIRS': [
os.path.join(PROJECT_DIR, 'membership/'), # membership template os.path.join(PROJECT_DIR, 'membership/'), # membership template
os.path.join(PROJECT_DIR,'templates/'),
os.path.join(PROJECT_DIR,'templates/digitalglarus/partials'),
os.path.join(PROJECT_DIR,'templates/cms'),
os.path.join(PROJECT_DIR,'templates/digitalglarus'),
], ],
'APP_DIRS': True, 'APP_DIRS': True,
'OPTIONS': { 'OPTIONS': {

View file

@ -51,7 +51,7 @@ class CustomUser(AbstractBaseUser):
objects = MyUserManager() objects = MyUserManager()
USERNAME_FIELD = "email" USERNAME_FIELD = "email"
REQUIRED_FIELDS = ['name','password'] REQUIRED_FIELDS = ['name', 'password']
@classmethod @classmethod
def register(cls, name, password, email): def register(cls, name, password, email):
@ -60,7 +60,8 @@ class CustomUser(AbstractBaseUser):
user = cls.objects.create_user(username=name, email=email, password=password) user = cls.objects.create_user(username=name, email=email, password=password)
if user: if user:
user.validation_slug = make_password(None) user.validation_slug = make_password(None)
send_mail(REGISTRATION_MESSAGE['subject'], REGISTRATION_MESSAGE['message'].format(user.validation_slug), send_mail(REGISTRATION_MESSAGE['subject'],
REGISTRATION_MESSAGE['message'].format(user.validation_slug),
REGISTRATION_MESSAGE['from'], [user.email], fail_silently=False) REGISTRATION_MESSAGE['from'], [user.email], fail_silently=False)
return user return user
else: else:
@ -75,8 +76,10 @@ class CustomUser(AbstractBaseUser):
user.validated = 1 user.validated = 1
return True return True
return False return False
def is_superuser(self): def is_superuser(self):
return True return True
def is_admin(self): def is_admin(self):
return True return True
@ -107,7 +110,6 @@ class CustomUser(AbstractBaseUser):
# Simplest possible answer: All admins are staff # Simplest possible answer: All admins are staff
return self.is_admin return self.is_admin
# class CreditCards(models.Model): # class CreditCards(models.Model):
# id = models.IntegerField(primary_key=True) # id = models.IntegerField(primary_key=True)
# user_id = models.ForeignKey(User, on_delete=models.CASCADE) # user_id = models.ForeignKey(User, on_delete=models.CASCADE)

View file

@ -92,7 +92,6 @@ pyzmq==14.7.0
requests==2.7.0 requests==2.7.0
simplejson==3.8.0 simplejson==3.8.0
six==1.10.0 six==1.10.0
South==1.0.2
sqlparse==0.1.15 sqlparse==0.1.15
stripe==1.22.3 stripe==1.22.3
tomako==0.1.0 tomako==0.1.0
@ -100,5 +99,4 @@ TornadIO2==0.0.3
tornado==4.2.1 tornado==4.2.1
Unidecode==0.4.19 Unidecode==0.4.19
URLObject==2.4.0 URLObject==2.4.0
wheel==0.29.0
YURL==0.13 YURL==0.13

View file

@ -51,7 +51,7 @@
{% cms_toolbar %} {% cms_toolbar %}
<div class="brand">Digital Glarus</div> <div class="brand">Digital Glarus</div>
<div class="address-bar"> <div class="address-bar">
{% placeholder 'digital_glarus_legend' %} {# {% placeholder 'digital_glarus_legend' %}#}
</div> </div>
<div class="center-block"> <div class="center-block">
<ul class="list-inline center-block language-chooser-list"> <ul class="list-inline center-block language-chooser-list">

View file

@ -1,4 +1,4 @@
{% extends "cms/digitalglarus/base.html" %} {% extends "digitalglarus/base.html" %}
{% load staticfiles cms_tags %} {% load staticfiles cms_tags %}
{% block title %}crowdfunding{% endblock %} {% block title %}crowdfunding{% endblock %}