Skip to content
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

Merged
merged 13 commits into from
Nov 12, 2019
Merged

#29 agendar un turno #89

merged 13 commits into from
Nov 12, 2019

Conversation

alantoris
Copy link

No description provided.

@@ -0,0 +1,272 @@
{% extends "base_admin.html" %}
{% load static %}

Copy link
Collaborator

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">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

para qué usamos esto?

Copy link
Author

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'
Copy link
Collaborator

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 %} ?

Copy link
Contributor

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

@alantoris alantoris changed the title WIP - #29 agendar un turno #29 agendar un turno Nov 12, 2019
@alantoris alantoris changed the title #29 agendar un turno WIP : #29 agendar un turno Nov 12, 2019
@alantoris alantoris changed the title WIP : #29 agendar un turno #29 agendar un turno Nov 12, 2019
'inicio': datetime.strftime(self.inicio, '%d/%m/%Y %H:%M'),
'servicio': self.servicio.especialidad.nombre,
'profesional': '{}, {}'.format(
self.profesional.apellidos, self.profesional.nombres),
Copy link
Member

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):
Copy link
Member

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):
Copy link
Member

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

Copy link
Contributor

@pardo-bsso pardo-bsso Nov 12, 2019

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.

@avdata99
Copy link
Member

Tenes varios detalles a revisar en este PR @alantoris

@alantoris
Copy link
Author

Tenes varios detalles a revisar en este PR @alantoris

Ya podes revisarlo nuevamente

@avdata99 avdata99 merged commit 9b9e19d into master Nov 12, 2019
@avdata99 avdata99 deleted the 29-SolicitarTurno branch November 12, 2019 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants