Commit 6f715a04 authored by Jean-Baptiste's avatar Jean-Baptiste

update: send activity on new job offer

parent ffc9ea71
Pipeline #5013 passed with stage
in 27 seconds
......@@ -40,8 +40,15 @@ try:
def on_follower(sender, instance, **kwargs):
if not instance.confirmed:
actor_url = urlparse(instance.local_id)
model = Model.resolve_id(actor_url.path)
if isinstance(model, JobOffer):
model, obj = Model.resolve(actor_url.path)
if model == JobOffer:
@receiver(post_save, sender=JobOffer)
def on_jobr(sender, instance, **kwargs):
content = "{}\n{}\n".format(instance.title, instance.description)
for skill in instance.skills.all():
content = "{} #{}".format(content, skill)
AP.create_activity(AP.note(JobOffer, content))
except ModuleNotFoundError:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment