diff --git a/fiesta/apps/accounts/migrations/0017_alter_userprofile_instagram.py b/fiesta/apps/accounts/migrations/0017_alter_userprofile_instagram.py new file mode 100644 index 00000000..594c9ef8 --- /dev/null +++ b/fiesta/apps/accounts/migrations/0017_alter_userprofile_instagram.py @@ -0,0 +1,19 @@ +# Generated by Django 4.2.4 on 2023-09-02 12:04 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounts', '0016_userprofile_facebook_userprofile_instagram_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='userprofile', + name='instagram', + field=models.CharField(blank=True, validators=[django.core.validators.RegexValidator('^[\\w\\-_.]+$')], verbose_name='instagram username'), + ), + ] diff --git a/fiesta/apps/buddy_system/forms.py b/fiesta/apps/buddy_system/forms.py index e63be5ae..c0080dd1 100644 --- a/fiesta/apps/buddy_system/forms.py +++ b/fiesta/apps/buddy_system/forms.py @@ -29,7 +29,7 @@ class NewBuddyRequestForm(BaseModelForm): class Meta: model = BuddyRequest fields = ( - "description", + "issuer_note", "interests", "responsible_section", "issuer", @@ -42,12 +42,12 @@ class Meta: "issuer": HiddenInput, } labels = { - "description": _("Tell us about yourself"), + "issuer_note": _("Tell us about yourself"), "interests": _("What are you into?"), } help_texts = { - "description": lazy( - lambda: render_to_string("buddy_system/parts/buddy_request_description_help.html"), + "issuer_note": lazy( + lambda: render_to_string("buddy_system/parts/buddy_request_issuer_note_help.html"), str, ) } @@ -67,7 +67,7 @@ def __init__(self, *args, **kwargs): if self.instance.state != BuddyRequest.State.CREATED: self.fields["matched_by"].disabled = True self.fields["matched_at"].disabled = True - self.fields["description"].disabled = True + self.fields["issuer_note"].disabled = True self.fields["interests"].disabled = True class Meta: @@ -75,7 +75,7 @@ class Meta: fields = ( "issuer", "state", - "description", + "issuer_note", "interests", "matched_by", "matched_at", diff --git a/fiesta/apps/buddy_system/migrations/0020_rename_description_buddyrequest_issuer_note.py b/fiesta/apps/buddy_system/migrations/0020_rename_description_buddyrequest_issuer_note.py new file mode 100644 index 00000000..3088706c --- /dev/null +++ b/fiesta/apps/buddy_system/migrations/0020_rename_description_buddyrequest_issuer_note.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.4 on 2023-09-02 12:04 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('buddy_system', '0019_alter_buddyrequest_options'), + ] + + operations = [ + migrations.RenameField( + model_name='buddyrequest', + old_name='description', + new_name='issuer_note', + ), + ] diff --git a/fiesta/apps/buddy_system/templates/buddy_system/index_international.html b/fiesta/apps/buddy_system/templates/buddy_system/index_international.html index a2cc5107..3200a51b 100644 --- a/fiesta/apps/buddy_system/templates/buddy_system/index_international.html +++ b/fiesta/apps/buddy_system/templates/buddy_system/index_international.html @@ -42,7 +42,7 @@

{% endif %} -
{{ br.description }}
+
{{ br.issuer_note }}
diff --git a/fiesta/apps/fiestarequests/models/configuration.py b/fiesta/apps/fiestarequests/models/configuration.py index ea070a06..72842fa4 100644 --- a/fiesta/apps/fiestarequests/models/configuration.py +++ b/fiesta/apps/fiestarequests/models/configuration.py @@ -1,6 +1,7 @@ from __future__ import annotations from django.db import models +from django.utils.translation import gettext_lazy as _ from apps.fiestarequests.matching_policy import MatchingPoliciesRegister from apps.plugins.models import BasePluginConfiguration @@ -23,6 +24,11 @@ class BaseRequestSystemConfiguration(BasePluginConfiguration): help_text=MatchingPoliciesRegister.DESCRIPTION, ) + enable_note_from_matcher = models.BooleanField( + default=True, + help_text=_("Allows matcher to reply with custom notes to the request issuer"), + ) + @property def matching_policy_instance(self): # TODO: pass configuration? diff --git a/fiesta/apps/fiestarequests/models/request.py b/fiesta/apps/fiestarequests/models/request.py index 0ace4ac7..60ac1d35 100644 --- a/fiesta/apps/fiestarequests/models/request.py +++ b/fiesta/apps/fiestarequests/models/request.py @@ -33,6 +33,10 @@ class State(TextChoices): def base_request_model_factory(related_base: str): + """ + Creates a base model for requests-like models. + """ + class BaseRequest(LifecycleModelMixin, BaseTimestampedModel): class Meta(BaseTimestampedModel.Meta): abstract = True @@ -44,8 +48,8 @@ class Meta(BaseTimestampedModel.Meta): state = models.CharField( verbose_name=_("state"), - choices=BaseRequestProtocol.State.choices, - default=BaseRequestProtocol.State.CREATED, + choices=State.choices, + default=State.CREATED, max_length=16, ) issuer = models.ForeignKey( @@ -77,8 +81,12 @@ class Meta(BaseTimestampedModel.Meta): blank=True, ) - description = models.TextField( - verbose_name=_("description"), + issuer_note = models.TextField( + verbose_name=_("text from issuer"), + ) + + matcher_note = models.TextField( + verbose_name=_("text from matcher"), ) @hook(BEFORE_SAVE, when="matched_by", was=None, is_not=None) diff --git a/fiesta/apps/plugins/migrations/0014_alter_plugin_app_label.py b/fiesta/apps/plugins/migrations/0014_alter_plugin_app_label.py new file mode 100644 index 00000000..1fed9e4f --- /dev/null +++ b/fiesta/apps/plugins/migrations/0014_alter_plugin_app_label.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.4 on 2023-09-02 12:04 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('plugins', '0013_alter_plugin_app_label'), + ] + + operations = [ + migrations.AlterField( + model_name='plugin', + name='app_label', + field=models.CharField(choices=[('buddy_system', 'Buddy System'), ('dashboard', 'Dashboard'), ('sections', 'ESN section'), ('esncards', 'ESNcard'), ('pages', 'Pages')], help_text='Defines system application, which specific plugin represents.', max_length=256, verbose_name='app label'), + ), + ] diff --git a/fiesta/apps/sections/migrations/0015_alter_sectionsconfiguration_required_gender_and_more.py b/fiesta/apps/sections/migrations/0015_alter_sectionsconfiguration_required_gender_and_more.py new file mode 100644 index 00000000..55aff879 --- /dev/null +++ b/fiesta/apps/sections/migrations/0015_alter_sectionsconfiguration_required_gender_and_more.py @@ -0,0 +1,38 @@ +# Generated by Django 4.2.4 on 2023-09-02 12:04 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('sections', '0014_alter_sectionmembership_role'), + ] + + operations = [ + migrations.AlterField( + model_name='sectionsconfiguration', + name='required_gender', + field=models.BooleanField(blank=True, default=None, help_text='Flag if field is needed to fill in user profile: True=field is required, False=field is optional, None=field is not available', null=True, verbose_name='required gender'), + ), + migrations.AlterField( + model_name='sectionsconfiguration', + name='required_interests', + field=models.BooleanField(blank=True, default=None, help_text='Flag if field is needed to fill in user profile: True=field is required, False=field is optional, None=field is not available', null=True, verbose_name='required interests'), + ), + migrations.AlterField( + model_name='sectionsconfiguration', + name='required_nationality', + field=models.BooleanField(blank=True, default=None, help_text='Flag if field is needed to fill in user profile: True=field is required, False=field is optional, None=field is not available', null=True, verbose_name='required nationality'), + ), + migrations.AlterField( + model_name='sectionsconfiguration', + name='required_phone_number', + field=models.BooleanField(blank=True, default=None, help_text='Flag if field is needed to fill in user profile: True=field is required, False=field is optional, None=field is not available', null=True, verbose_name='required phone number'), + ), + migrations.AlterField( + model_name='sectionsconfiguration', + name='required_picture', + field=models.BooleanField(blank=True, default=None, help_text='Flag if field is needed to fill in user profile: True=field is required, False=field is optional, None=field is not available', null=True, verbose_name='required profile picture'), + ), + ]