Resolve "Permission and button to unfinish visit or to add appointment."
Closes #351 (closed)
So, visits can only be unfinished if:
- there is only one visit after the finished visit
- such future visit has no appointments
- the user has the permission to do so (or superuser)
- the visit is indeed finished
When unfinishing a visit:
- The next visit will be removed
- The visit will be marked as not finished
Visits that cannot be unfinished:
- those with more than 1 subsequent visit
- those with 1 subsequent visit with appointments set
- if the user has no permissions
Please check this comment: https://git-r3lab.uni.lu/NCER-PD/scheduling-system/-/blob/351-unfinish-visit/smash/web/models/visit.py#L50
Some tooltips and help has been added for the user.
Edited by Carlos Vega