Users can register, log in, and manage profile/password in a personal account page; server data is scoped by owner across contacts, maps, tags, and import. Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
1012 B
Python
30 lines
1012 B
Python
DEFAULT_SECTORS = [
|
|
{'key': 'work', 'label': 'Работа'},
|
|
{'key': 'study', 'label': 'Учёба'},
|
|
{'key': 'hobby', 'label': 'Хобби'},
|
|
{'key': 'family', 'label': 'Семья'},
|
|
{'key': 'health', 'label': 'Здоровье'},
|
|
{'key': 'other', 'label': 'Другое'},
|
|
]
|
|
|
|
DEFAULT_CIRCLES = [
|
|
{'key': 'support', 'label': 'Круг поддержки'},
|
|
{'key': 'productivity', 'label': 'Круг продуктивности'},
|
|
{'key': 'development', 'label': 'Круг развития'},
|
|
]
|
|
|
|
|
|
def ensure_user_defaults(user):
|
|
"""Создаёт тип карты по умолчанию для нового пользователя."""
|
|
from contacts.models import NetworkMapType
|
|
|
|
if NetworkMapType.objects.filter(owner=user, is_default=True).exists():
|
|
return
|
|
NetworkMapType.objects.create(
|
|
owner=user,
|
|
is_default=True,
|
|
name='Стандартная',
|
|
sectors=DEFAULT_SECTORS,
|
|
circles=DEFAULT_CIRCLES,
|
|
)
|