Add configuration flags to ActivityCalendar to keep events within business hours & days.#1004
Add configuration flags to ActivityCalendar to keep events within business hours & days.#1004joehybird wants to merge 2 commits into
Conversation
| msgid "" | ||
| "The activity is not within the business hours range from {day_start} to " | ||
| "{day_end}." | ||
| msgstr "L'activité est en dehors des heures travaillées de {day_start} à {day_end}" |
There was a problem hiding this comment.
Rename '0031_v2_7__calendarconfigitem_allow_event_anyday_n_overtime.py'
| config = CalendarConfigItem(role=role) | ||
| config.allow_event_overtime = True | ||
| config.allow_event_anyday = True | ||
| config.save() |
There was a problem hiding this comment.
config = CalendarConfigItem.objects.create(role=role, allow_event_overtime=True, allow_event_anyday=True)
| user = self.create_user(role=role, password='test') | ||
| other_user = self.create_user(username='other', role=other_role, password='test') |
There was a problem hiding this comment.
user1 = self.login_as_standard() # then use user1.role
user2 = self.create_user(index=1, role=self.get_regular_role()) # then use user2.role
(You are creating 2 users with the same first_name/last_name)
| owner = get_user_model().filter(pk=activity.user_id).first() | ||
|
|
||
| if owner is None: | ||
| owner = user |
There was a problem hiding this comment.
If I understand sometimes the owner of the activity has not been assigned yet
- A simpler code would be
owner = activity.user if activity.user_id else user - I do not understand the logic. I presume the hours constraints concern the participants, & so the activity should be checked with the config items of the users participants; the owner of the activity & the logged user seem not relevant.
There was a problem hiding this comment.
Great, you've gone straight to the point that is bothering me 😅 : whom constraint should be used ?
I didn't though about the participants... If I understand we should apply the constraints of ALL the participants to the event movement. 🤔
14cdc28 to
b5c8a71
Compare
…/move/resize outside business hours & days.
b5c8a71 to
d066117
Compare
No description provided.