-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#29 agendar un turno #89
Conversation
@@ -0,0 +1,272 @@ | |||
{% extends "base_admin.html" %} | |||
{% load static %} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no hay un template base que ya incluya todas estas dependencias?
<link href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/4.2.0/bootstrap/main.css" rel="stylesheet" /> | ||
<link href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/4.2.0/daygrid/main.css" rel="stylesheet" /> | ||
|
||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.4/css/bootstrap2/bootstrap-switch.min.css"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
para qué usamos esto?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me quedo copiada del archivo en el que me base, me falto borrarla algunas cosas que no se van a utilizar en le seccion de agendar un turno
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> | ||
<script> | ||
'use strict'; | ||
axios.defaults.xsrfCookieName = 'csrftoken' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
esto no deberia ser el valor de {% csrftoken %}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mgaitan ese valor también se setea en una cookie
…into 29-SolicitarTurno
calendario/models.py
Outdated
'inicio': datetime.strftime(self.inicio, '%d/%m/%Y %H:%M'), | ||
'servicio': self.servicio.especialidad.nombre, | ||
'profesional': '{}, {}'.format( | ||
self.profesional.apellidos, self.profesional.nombres), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Si el profesional es None esto va a dar error
return Turno.objects.filter(servicio__centro__in=centros_de_salud_permitidos, **kw) | ||
|
||
|
||
def agendar(request): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¿Que permisos se requieren para acceder a esta vista?
Al parecer esta abierta a todos. Restringir
return render(request, 'calendario-agregar.html', context) | ||
|
||
|
||
def confirm_turn(request, pk): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¿Que permisos se requieren para acceder a esta vista?
Al parecer esta abierta a todos. Restringir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sumado a eso, fijate que ahora esa view responde tanto a POSTs (lo que viene del form o axios) como a GETs simples.
Aparte (esto va igual para el resto de las views simples) no verifica que el csrftoken sea válido. (me corrijo: si usas render() ya se chequea solo. Pero eso pasa al final después de que procesaste el form y todo, así que sigue siendo válido el punto.)
Por ahí usar de base una UpdateView sirva.
Tenes varios detalles a revisar en este PR @alantoris |
Ya podes revisarlo nuevamente |
No description provided.