From 9a2a35185896af0f27b01f9d7aecf096d0cd31f2 Mon Sep 17 00:00:00 2001 From: Alexander-D-Karpov Date: Wed, 27 Dec 2023 02:16:08 +0300 Subject: [PATCH] minor updates --- .../0013_user_agree_data_to_be_sold.py | 17 +++++++++++++++++ akarpov/users/models.py | 4 +++- akarpov/users/views.py | 2 +- compose/local/django/Dockerfile | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 akarpov/users/migrations/0013_user_agree_data_to_be_sold.py diff --git a/akarpov/users/migrations/0013_user_agree_data_to_be_sold.py b/akarpov/users/migrations/0013_user_agree_data_to_be_sold.py new file mode 100644 index 0000000..f0942c3 --- /dev/null +++ b/akarpov/users/migrations/0013_user_agree_data_to_be_sold.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.8 on 2023-12-26 22:55 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("users", "0012_user_theme"), + ] + + operations = [ + migrations.AddField( + model_name="user", + name="agree_data_to_be_sold", + field=models.BooleanField(default=False), + ), + ] diff --git a/akarpov/users/models.py b/akarpov/users/models.py index 4d65ffe..3578b24 100644 --- a/akarpov/users/models.py +++ b/akarpov/users/models.py @@ -29,7 +29,9 @@ class User(AbstractUser, BaseImageModel, ShortLinkModel): "Left file upload(in bites)", default=0, validators=[MinValueValidator(0)] ) theme = models.ForeignKey("themes.Theme", null=True, on_delete=models.SET_NULL) - agree_data_to_be_sold = models.BooleanField(default=False) + agree_data_to_be_sold = models.BooleanField( + "Agree my data to be sold to vendors", default=False + ) def get_theme_url(self): if self.theme_id: diff --git a/akarpov/users/views.py b/akarpov/users/views.py index 68708e0..333fed3 100644 --- a/akarpov/users/views.py +++ b/akarpov/users/views.py @@ -23,7 +23,7 @@ class UserDetailView(DetailView): class UserUpdateView(LoginRequiredMixin, SuccessMessageMixin, UpdateView): model = User - fields = ["username", "name", "image", "about"] + fields = ["username", "name", "image", "about", "agree_data_to_be_sold"] success_message = _("Information successfully updated") def get_success_url(self): diff --git a/compose/local/django/Dockerfile b/compose/local/django/Dockerfile index 75b22ac..cf26bec 100644 --- a/compose/local/django/Dockerfile +++ b/compose/local/django/Dockerfile @@ -27,7 +27,7 @@ WORKDIR ${APP_HOME} RUN apt-get update && \ apt-get install -y build-essential libpq-dev gettext libmagic-dev libjpeg-dev zlib1g-dev && \ # Dependencies for file preview generation - apt-get install -y webp libimage-exiftool-perl libmagickwand-dev ffmpeg libgdal-dev && \ + apt-get install -y webp git libimage-exiftool-perl libmagickwand-dev ffmpeg libgdal-dev && \ # ML dependencies \ # none for now apt-get purge -y --auto-remove -o APT:AutoRemove:RecommendsImportant=false && \