mirror of https://gitlab.federez.net/re2o/re2o
10 changed files with 233 additions and 91 deletions
@ -0,0 +1,61 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.10.7 on 2017-10-24 23:54 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
import django.db.models.deletion |
||||
|
|
||||
|
def create_move_room(apps, schema_editor): |
||||
|
User = apps.get_model('users', 'User') |
||||
|
Adherent = apps.get_model('users', 'Adherent') |
||||
|
Club = apps.get_model('users', 'Club') |
||||
|
db_alias = schema_editor.connection.alias |
||||
|
users = Adherent.objects.using(db_alias).all() |
||||
|
clubs = Club.objects.using(db_alias).all() |
||||
|
for user in users: |
||||
|
user.room_adherent_id = user.room_id |
||||
|
user.save(using=db_alias) |
||||
|
for user in clubs: |
||||
|
user.room_club_id = user.room_id |
||||
|
user.save(using=db_alias) |
||||
|
|
||||
|
|
||||
|
def delete_move_room(apps, schema_editor): |
||||
|
User = apps.get_model('users', 'User') |
||||
|
Adherent = apps.get_model('users', 'Adherent') |
||||
|
Club = apps.get_model('users', 'Club') |
||||
|
db_alias = schema_editor.connection.alias |
||||
|
users = Adherent.objects.using(db_alias).all() |
||||
|
clubs = Club.objects.using(db_alias).all() |
||||
|
for user in users: |
||||
|
user.room_id = user.room_adherent_id |
||||
|
user.save(using=db_alias) |
||||
|
for user in clubs: |
||||
|
user.room_id = user.room_club_id |
||||
|
user.save(using=db_alias) |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('topologie', '0031_auto_20171015_2033'), |
||||
|
('users', '0057_auto_20171023_0301'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AddField( |
||||
|
model_name='adherent', |
||||
|
name='room_adherent', |
||||
|
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='topologie.Room'), |
||||
|
), |
||||
|
migrations.AddField( |
||||
|
model_name='club', |
||||
|
name='room_club', |
||||
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='topologie.Room'), |
||||
|
), |
||||
|
migrations.RunPython(create_move_room, delete_move_room), |
||||
|
migrations.RemoveField( |
||||
|
model_name='user', |
||||
|
name='room', |
||||
|
), |
||||
|
] |
||||
@ -0,0 +1,25 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.10.7 on 2017-10-25 16:54 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import migrations |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('users', '0058_auto_20171025_0154'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.RenameField( |
||||
|
model_name='adherent', |
||||
|
old_name='room_adherent', |
||||
|
new_name='room', |
||||
|
), |
||||
|
migrations.RenameField( |
||||
|
model_name='club', |
||||
|
old_name='room_club', |
||||
|
new_name='room', |
||||
|
), |
||||
|
] |
||||
@ -0,0 +1,27 @@ |
|||||
|
<p>Bonjour {{nom}} </p> |
||||
|
|
||||
|
<p>Une nouvelle machine a automatiquement été inscrite sur votre compte.</p> |
||||
|
|
||||
|
<p>Si vous êtes à l'origine de la connexion de cet appareil en filaire ou wifi, ne tenez pas compte de cette notification</p> |
||||
|
|
||||
|
<p>La nouvelle machine possède l'adresse mac {{ mac_address }}, et s'est vu assigner le nom suivant : {{ interface_name }}</p> |
||||
|
|
||||
|
<p>Vous pouvez à tout moment modifier ces informations sur votre compte en ligne</p> |
||||
|
|
||||
|
<p>Si vous n'êtes pas à l'origine de cette connexion, merci de le signaler rapidement à {{asso_email}}</p> |
||||
|
|
||||
|
<p>À bientôt,<br> |
||||
|
L'équipe de {{asso_name}}.</p> |
||||
|
|
||||
|
<p>---</p> |
||||
|
|
||||
|
<p>A new device has been automatically added on your account.</p> |
||||
|
|
||||
|
<p>If you connected a new device recently, please don't take this mail into account<p> |
||||
|
|
||||
|
<p>The new device has this mac address : {{ mac_address }}, and this name : {{ interface_name }}</p> |
||||
|
|
||||
|
<p>Please contact us if you didn't connect a new device with this mail address {{asso_email}}.</p> |
||||
|
|
||||
|
<p>Regards,<br> |
||||
|
The {{asso_name}} team.</p> |
||||
Loading…
Reference in new issue