|
|
@ -28,26 +28,23 @@ def resitel_to_osoba(apps,schema_editor): |
|
|
|
if u.first_name: |
|
|
|
if not o.jmeno: |
|
|
|
o.jmeno = u.first_name |
|
|
|
u.first_name = 'Použij osobu!' |
|
|
|
u.first_name += ' (Uživatel!)' |
|
|
|
elif o.jmeno == u.first_name: |
|
|
|
u.first_name = 'Použij osobu!' |
|
|
|
u.first_name += ' (Uživatel!)' |
|
|
|
else: |
|
|
|
raise ValueError('jmeno a first_name rozdílné: "{}" vs. "{}"'.format(o.jmeno, u.first_name)) |
|
|
|
if u.last_name: |
|
|
|
if not o.prijmeni: |
|
|
|
o.prijmeni = u.last_name |
|
|
|
u.last_name = 'Použij osobu!' |
|
|
|
u.last_name += ' (Uživatel!)' |
|
|
|
elif o.prijmeni == u.last_name: |
|
|
|
u.last_name = 'Použij osobu!' |
|
|
|
u.last_name += ' (Uživatel!)' |
|
|
|
else: |
|
|
|
raise ValueError('prijmeni a last_name rozdílné: "{}" vs. "{}"'.format(o.prijmeni, u.last_name)) |
|
|
|
if u.email: |
|
|
|
if not o.email: |
|
|
|
o.email = u.email |
|
|
|
u.email = 'Použij osobu!' |
|
|
|
elif o.email == u.email: |
|
|
|
u.email = 'Použij osobu!' |
|
|
|
else: |
|
|
|
elif o.email != u.email: |
|
|
|
raise ValueError('o.email a u.email rozdílné: "{}" vs. "{}"'.format(o.email, u.email)) |
|
|
|
u.save() |
|
|
|
|
|
|
|