Changeset b48da64 in firmaeventos
- Timestamp:
- Nov 21, 2017, 4:20:54 PM (6 years ago)
- Branches:
- master
- Children:
- 8ec4f0b
- Parents:
- d60a9ab
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
participantes/views.py
rd60a9ab rb48da64 4 4 5 5 from .models import ( 6 ParticipanteEvento 6 ParticipanteEvento, Participante 7 7 ) 8 8 from eventos.models import ( … … 71 71 if evento_id is not None and pasaporte is not None: 72 72 if serial is not None: 73 update_evento = self.model.object.get(pk=evento_id) 74 update_evento.serial = serial 75 update_evento.save() 76 mensaje += 'Se actualizo el serial del evento \n' 77 update_parti_event = self.model_participante.object.get( 78 pasaporte=pasaporte) 79 update_parti_event.firma = True 80 update_parti_event.save() 81 mensaje += 'Se actualizo la firma del participante %s, \ 82 para el evento %s' % (update_parti_event.fk_participante.nombres, 83 update_parti_event.fk_evento.nombre_evento) 84 validate = True 73 try: 74 update_evento = self.model.object.get(pk=evento_id) 75 update_evento.serial = serial 76 update_evento.save() 77 mensaje += 'Se actualizo el serial del evento \n' 78 except Exception as e: 79 print (e) 80 validate = False 81 mensaje += 'No existe el evento que desea actualizar \n' 82 try: 83 participante = Participante.object.get(pasaporte=pasaporte) 84 except Exception as e: 85 print (e) 86 validate = False 87 mensaje += 'El pasaporte no coincide con los\ 88 participantes que se ecuentran registrados \n' 89 try: 90 update_parti_event = self.model_participante.object.get( 91 fk_participante=participante.pk, 92 fk_evento=evento_id) 93 update_parti_event.firma = True 94 update_parti_event.save() 95 mensaje += 'Se actualizo la firma del participante %s, \ 96 para el evento %s' % (update_parti_event.fk_participante.nombres, 97 update_parti_event.fk_evento.nombre_evento) 98 validate = True 99 except Exception as e: 100 print(e) 101 validate = False 102 mensaje += 'El evento no esta asociado al participante\ 103 o no se encuentra registrado\n' 104 85 105 else: 86 106 mensaje += 'Debes enviar al menos\
Note: See TracChangeset
for help on using the changeset viewer.