mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 06:03:20 +00:00
Merge branch 'sli' into 'master'
Fixed old database bug in dev env See merge request !2
This commit is contained in:
commit
d93dda1c0e
@ -240,7 +240,7 @@ class User(AbstractBaseUser):
|
||||
else:
|
||||
create = True
|
||||
super(User, self).save(*args, **kwargs)
|
||||
if create: # Create user on the old site: TODO remove me!
|
||||
if create and settings.IS_OLD_MYSQL_PRESENT: # Create user on the old site: TODO remove me!
|
||||
import MySQLdb
|
||||
try:
|
||||
db = MySQLdb.connect(**settings.OLD_MYSQL_INFOS)
|
||||
|
@ -17,7 +17,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
os.environ['HTTPS'] = "on"
|
||||
os.environ['HTTPS'] = "off"
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
|
||||
@ -195,6 +195,7 @@ LOGIN_REDIRECT_URL = '/'
|
||||
DEFAULT_FROM_EMAIL="bibou@git.an"
|
||||
|
||||
# Email
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
||||
EMAIL_HOST="localhost"
|
||||
EMAIL_PORT=25
|
||||
|
||||
@ -409,6 +410,7 @@ SITH_LAUNDERETTE_PRICES = {
|
||||
'DRYING': 0.75,
|
||||
}
|
||||
|
||||
IS_OLD_MYSQL_PRESENT = False
|
||||
OLD_MYSQL_INFOS = {
|
||||
'host': 'ae-db',
|
||||
'user': "my_user",
|
||||
|
@ -33,7 +33,7 @@ class Subscriber(User):
|
||||
if not self.id:
|
||||
create = True
|
||||
super(Subscriber, self).save()
|
||||
if create:
|
||||
if create and settings.IS_OLD_MYSQL_PRESENT:
|
||||
try: # Create user on the old site: TODO remove me!
|
||||
db = MySQLdb.connect(**settings.OLD_MYSQL_INFOS)
|
||||
c = db.cursor()
|
||||
@ -82,6 +82,7 @@ class Subscription(models.Model):
|
||||
form.save(use_https=True, email_template_name='core/new_user_email.jinja',
|
||||
subject_template_name='core/new_user_email_subject.jinja', from_email="ae@utbm.fr")
|
||||
self.member.make_home()
|
||||
if settings.IS_OLD_MYSQL_PRESENT:
|
||||
try: # Create subscription on the old site: TODO remove me!
|
||||
LOCATION = {
|
||||
"SEVENANS": 5,
|
||||
|
Loading…
Reference in New Issue
Block a user