ephios
ephios copied to clipboard
assign workinghours to participants on federated instances
closes #1501
- [x] pull consequences from FederatedHost and create them locally
- [ ] migrate consequeces?
coverage: 83.991% (+0.02%) from 83.971% when pulling a545fbd433c2848a7fbfe0b7df43882b44715c60 on federated-workinghours into 9b22c56b5bbe913ca14a83c2ccd6a8d831aee3b7 on main.
Here's what we discussed about queryset filtering:
def blub():
handlers = [...]
consequence_classes = AbstractConsequence.__subclasses__()
qs = AbstractConsequence.objects.filter(slug__in=map(operator.attrgetter("slug"), handlers)).distinct()
for handler in enabled_consequence_handlers:
for ConcreteConsequence in consequence_classes:
qs = ConcreteConsequence.filter_queryset(handler, qs, user)
# ==> rather ditch annotations and OR Q-Objects
return qs
def localConsequence_filter_queryset(handler, qs, user):
return handler.filter_local_queryset(qs, user) # filter for nonlocal or other handler or matches criteria
def federatedConsequence_filter_queryset(handler, qs, user):
return qs.filter(
Q("is not federated") | Q("matches criteria")
)