|
|
|
@ -25,98 +25,122 @@ def celery_update_parcels(geometry_id: str, recheck: bool = True):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
|
|
|
|
def celery_send_mail_shared_access_removed(obj_id, obj_class, user_id=None, municipals_names=[]):
|
|
|
|
|
def celery_send_mail_shared_access_removed(obj_id, obj_class, user_id=None):
|
|
|
|
|
from user.models import User
|
|
|
|
|
user = User.objects.get(id=user_id)
|
|
|
|
|
obj = obj_class.objects.get(id=obj_id)
|
|
|
|
|
|
|
|
|
|
municipals_names = list(obj.geometry.get_underlying_municipals().values_list("name", flat=True))
|
|
|
|
|
user.send_mail_shared_access_removed(obj, municipals_names)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
|
|
|
|
def celery_send_mail_shared_access_given(obj_id, obj_class, user_id=None, municipals_names=[]):
|
|
|
|
|
def celery_send_mail_shared_access_given(obj_id, obj_class, user_id=None):
|
|
|
|
|
from user.models import User
|
|
|
|
|
user = User.objects.get(id=user_id)
|
|
|
|
|
obj = obj_class.objects.get(id=obj_id)
|
|
|
|
|
|
|
|
|
|
municipals_names = list(obj.geometry.get_underlying_municipals().values_list("name", flat=True))
|
|
|
|
|
user.send_mail_shared_access_given(obj, municipals_names)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
|
|
|
|
def celery_send_mail_shared_access_removed_team(obj_id, obj_class, team_id=None, municipals_names=[]):
|
|
|
|
|
def celery_send_mail_shared_access_removed_team(obj_id, obj_class, team_id=None):
|
|
|
|
|
from user.models import Team
|
|
|
|
|
team = Team.objects.get(id=team_id)
|
|
|
|
|
obj = obj_class.objects.get(id=obj_id)
|
|
|
|
|
|
|
|
|
|
municipals_names = list(obj.geometry.get_underlying_municipals().values_list("name", flat=True))
|
|
|
|
|
team.send_mail_shared_access_removed(obj, municipals_names)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
|
|
|
|
def celery_send_mail_shared_access_given_team(obj_id, obj_class, team_id=None, municipals_names=[]):
|
|
|
|
|
def celery_send_mail_shared_access_given_team(obj_id, obj_class, team_id=None):
|
|
|
|
|
from user.models import Team
|
|
|
|
|
team = Team.objects.get(id=team_id)
|
|
|
|
|
obj = obj_class.objects.get(id=obj_id)
|
|
|
|
|
|
|
|
|
|
municipals_names = list(obj.geometry.get_underlying_municipals().values_list("name", flat=True))
|
|
|
|
|
team.send_mail_shared_access_given_team(obj, municipals_names)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
|
|
|
|
def celery_send_mail_shared_data_recorded(obj_id, obj_class, user_id=None, municipals_names=[]):
|
|
|
|
|
def celery_send_mail_shared_data_recorded(obj_id, obj_class, user_id=None):
|
|
|
|
|
from user.models import User
|
|
|
|
|
user = User.objects.get(id=user_id)
|
|
|
|
|
obj = obj_class.objects.get(id=obj_id)
|
|
|
|
|
|
|
|
|
|
municipals_names = list(obj.geometry.get_underlying_municipals().values_list("name", flat=True))
|
|
|
|
|
user.send_mail_shared_data_recorded(obj, municipals_names)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
|
|
|
|
def celery_send_mail_shared_data_unrecorded(obj_id, obj_class, user_id=None, municipals_names=[]):
|
|
|
|
|
def celery_send_mail_shared_data_unrecorded(obj_id, obj_class, user_id=None):
|
|
|
|
|
from user.models import User
|
|
|
|
|
user = User.objects.get(id=user_id)
|
|
|
|
|
obj = obj_class.objects.get(id=obj_id)
|
|
|
|
|
|
|
|
|
|
municipals_names = list(obj.geometry.get_underlying_municipals().values_list("name", flat=True))
|
|
|
|
|
user.send_mail_shared_data_unrecorded(obj, municipals_names)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
|
|
|
|
def celery_send_mail_shared_data_recorded_team(obj_id, obj_class, team_id=None, municipals_names=[]):
|
|
|
|
|
def celery_send_mail_shared_data_recorded_team(obj_id, obj_class, team_id=None):
|
|
|
|
|
from user.models import Team
|
|
|
|
|
team = Team.objects.get(id=team_id)
|
|
|
|
|
obj = obj_class.objects.get(id=obj_id)
|
|
|
|
|
|
|
|
|
|
municipals_names = list(obj.geometry.get_underlying_municipals().values_list("name", flat=True))
|
|
|
|
|
team.send_mail_shared_data_recorded(obj, municipals_names)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
|
|
|
|
def celery_send_mail_shared_data_unrecorded_team(obj_id, obj_class, team_id=None, municipals_names=[]):
|
|
|
|
|
def celery_send_mail_shared_data_unrecorded_team(obj_id, obj_class, team_id=None):
|
|
|
|
|
from user.models import Team
|
|
|
|
|
team = Team.objects.get(id=team_id)
|
|
|
|
|
obj = obj_class.objects.get(id=obj_id)
|
|
|
|
|
|
|
|
|
|
municipals_names = list(obj.geometry.get_underlying_municipals().values_list("name", flat=True))
|
|
|
|
|
team.send_mail_shared_data_unrecorded(obj, municipals_names)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
|
|
|
|
def celery_send_mail_shared_data_deleted(obj_id, obj_class, user_id=None, municipals_names=[]):
|
|
|
|
|
def celery_send_mail_shared_data_deleted(obj_id, obj_class, user_id=None):
|
|
|
|
|
from user.models import User
|
|
|
|
|
user = User.objects.get(id=user_id)
|
|
|
|
|
obj = obj_class.objects.get(id=obj_id)
|
|
|
|
|
|
|
|
|
|
municipals_names = list(obj.geometry.get_underlying_municipals().values_list("name", flat=True))
|
|
|
|
|
user.send_mail_shared_data_deleted(obj, municipals_names)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
|
|
|
|
def celery_send_mail_shared_data_checked(obj_id, obj_class, user_id=None, municipals_names=[]):
|
|
|
|
|
def celery_send_mail_shared_data_checked(obj_id, obj_class, user_id=None):
|
|
|
|
|
from user.models import User
|
|
|
|
|
user = User.objects.get(id=user_id)
|
|
|
|
|
obj = obj_class.objects.get(id=obj_id)
|
|
|
|
|
|
|
|
|
|
municipals_names = list(obj.geometry.get_underlying_municipals().values_list("name", flat=True))
|
|
|
|
|
user.send_mail_shared_data_checked(obj, municipals_names)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
|
|
|
|
def celery_send_mail_shared_data_deleted_team(obj_id, obj_class, team_id=None, municipals_names=[]):
|
|
|
|
|
def celery_send_mail_shared_data_deleted_team(obj_id, obj_class, team_id=None):
|
|
|
|
|
from user.models import Team
|
|
|
|
|
team = Team.objects.get(id=team_id)
|
|
|
|
|
obj = obj_class.objects.get(id=obj_id)
|
|
|
|
|
|
|
|
|
|
municipals_names = list(obj.geometry.get_underlying_municipals().values_list("name", flat=True))
|
|
|
|
|
team.send_mail_shared_data_deleted(obj, municipals_names)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
|
|
|
|
def celery_send_mail_shared_data_checked_team(obj_id, obj_class, team_id=None, municipals_names=[]):
|
|
|
|
|
def celery_send_mail_shared_data_checked_team(obj_id, obj_class, team_id=None):
|
|
|
|
|
from user.models import Team
|
|
|
|
|
team = Team.objects.get(id=team_id)
|
|
|
|
|
obj = obj_class.objects.get(id=obj_id)
|
|
|
|
|
|
|
|
|
|
municipals_names = list(obj.geometry.get_underlying_municipals().values_list("name", flat=True))
|
|
|
|
|
team.send_mail_shared_data_checked(obj, municipals_names)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|