Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
64 changes: 0 additions & 64 deletions core/management/commands/migrate_education.py

This file was deleted.

51 changes: 0 additions & 51 deletions core/management/commands/reverse_migrate_education.py

This file was deleted.

14 changes: 0 additions & 14 deletions log/migrated_users.json

This file was deleted.

6 changes: 3 additions & 3 deletions users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ class CustomUserAdmin(admin.ModelAdmin):
"status",
"city",
"region",
"organization", # TODO need to be removed in future.
"speciality",
"v2_speciality",
"key_skills",
Expand Down Expand Up @@ -264,6 +263,7 @@ def get_export_users_emails(self, users):
"collaborations__project",
"collaborations__project__industry",
"skills__skill",
"education",
)
)
little_mans = users.filter(birthday__lte=date_limit_18)
Expand All @@ -290,7 +290,7 @@ def get_export_users_emails(self, users):
baby.first_name + " " + baby.last_name,
today.year - baby.birthday.year,
", ".join(interests),
baby.organization,
"; ".join(baby.education.values_list("organization_name", flat=True)),
baby.v2_speciality if baby.v2_speciality else baby.speciality,
baby.email,
]
Expand All @@ -306,7 +306,7 @@ def get_export_users_emails(self, users):
big_man.first_name + " " + big_man.last_name,
today.year - big_man.birthday.year,
", ".join(industry_names),
big_man.organization,
"; ".join(big_man.education.values_list("organization_name", flat=True)),
big_man.v2_speciality
if big_man.v2_speciality
else big_man.speciality,
Expand Down
3 changes: 1 addition & 2 deletions users/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class UserFilter(filters.FilterSet):

Parameters to filter by:
first_name (str), last_name (str), patronymic (str),
city (str), region (str), organization (str), about_me__contains (str),
city (str), region (str), about_me__contains (str),
useful_to_project__contains (str)

Examples:
Expand Down Expand Up @@ -121,7 +121,6 @@ class Meta:
"patronymic",
"city",
"region",
"organization", # TODO need to be removed in future.
"user_type",
"speciality",
)
Expand Down
17 changes: 17 additions & 0 deletions users/migrations/0052_remove_customuser_organization.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.11 on 2024-10-25 09:18

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("users", "0051_alter_usereducation_options_customuser_phone_number_and_more"),
]

operations = [
migrations.RemoveField(
model_name="customuser",
name="organization",
),
]
10 changes: 1 addition & 9 deletions users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class CustomUser(AbstractUser):
status: CharField instance notifies about the user's status.
region: CharField instance the user's name region.
city: CharField instance the user's name city.
organization: CharField instance the user's place of study or work.
speciality: CharField instance the user's specialty.
datetime_updated: A DateTimeField indicating date of update.
datetime_created: A DateTimeField indicating date of creation.
Expand Down Expand Up @@ -104,13 +103,6 @@ class CustomUser(AbstractUser):
verbose_name="Номер телефона",
help_text="Пример: +7 XXX XX-XX-XX | +7XXXXXXXXX | +7 (XXX) XX-XX-XX"
)
# TODO need to be removed in future `organization` -> `education`.
organization = models.CharField(
max_length=255,
null=True,
blank=True,
help_text="Устаревшее поле -> UserEducation",
)
v2_speciality = models.ForeignKey(
on_delete=models.SET_NULL,
null=True,
Expand Down Expand Up @@ -179,7 +171,7 @@ def calculate_ordering_score(self) -> int:
if self.city:
score += 4
# TODO need to be removed in future.
if self.organization or self.education.all().exists():
if self.education.all().exists():
score += 6
if self.speciality:
score += 7
Expand Down
1 change: 0 additions & 1 deletion users/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,6 @@ class Meta:
"speciality",
"v2_speciality",
"v2_speciality_id",
"organization", # TODO need to be removed in future.
"education",
"work_experience",
"user_languages",
Expand Down