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: ...@@ -40,8 +40,15 @@ try:
def on_follower(sender, instance, **kwargs): def on_follower(sender, instance, **kwargs):
if not instance.confirmed: if not instance.confirmed:
actor_url = urlparse(instance.local_id) actor_url = urlparse(instance.local_id)
model = Model.resolve_id(actor_url.path) model, obj = Model.resolve(actor_url.path)
if isinstance(model, JobOffer): if model == JobOffer:
AP.accept(instance) AP.accept(instance)
@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: except ModuleNotFoundError:
pass pass
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