Repository: svthalia/concrexit

Issue:
Clarifying text on summary reward
Hi! I know you're less productive due to Corona, but on behalf of the educacie and with approval of the board I have this two-sided feature request. Thanks in advance!

### Is your feature request related to a problem? Please describe.
1) There is a rule in place that let's us reward the industrious students that write summaries and show them to others via [the Course Overview](https://thalia.nu/education/courses/). However, barely anyone knows this.

2) The feedback system for this rule, as people now just randomly get money on their bankaccounts. This might be confusing.

### Describe the solution you'd like
1) I want to show a little text to everyone visiting the course overview page.

2) Adding a field in the summary upload form in which the uploader can give his phone number. (maybe just a consent button and then take the phone number of the profile) This way we can contact them about it! 🌈 

### Motivation
It will encourage people to send in summaries and clear up the obscureness of this rule.

### Describe alternatives you've considered
Not do 2) or give people the option to type their own phone number instead of taking it from their account.

### Additional context

The little text mentioned before:

> You can submit your own summary! Better even, you might even get a monetary reward if your summary is:
> 
>  - In the current language of the course
>  - Adds significant information that was not already present in the summary overview
>  - Corresponds to the current course
>  - Is positively peer-reviewed by people appointed by the educacie
> 
> Don’t forget to authorise us to use your phone number, so we can inform you about your possible reward.

> 
> Je kan je eigen samenvatting inleveren! Beter zelfs, je kan zelfs een kleine geldelijke vergoeding krijgen als je samenvatting aan het volgende voldoet:
> 
>  - Hij is in de taal van de cursus
>  - Hij voegt significante informatie toe die niet in eerdere samenvattingen aanwezig was
>  - Hij moet overeenkomen met de inhoud van het vak
>  - Hij moet positief gepeer-reviewed worden door mensen die aangewezen zijn door de educacie
> 
> Vergeet ons niet toestemming te geven tot je telefoonnummer, dan kunnen we je op de hoogte houden van je mogelijke beloning.





Discussion:
The phone numbers in the user accounts are taken based on consent. Given that they're optional. So if people have entered a phone number we are allowed to just give you the phone number in the admin.

The privacy policy states:
> Thalia uses the phone number of members, benefactors and honorary members to communicate with members about activities of Thalia. Think about calling a participant who is too late for an activity or communicating a last-minute change.The processing of phone numbers by Thalia is optional. Processing of these data happens based on consent, which is given implicitly when the phone number is entered during registration or on the user profile on the website. 

Since giving people money for summaries is an activity of Thalia this can be seen as valid use of the information. And thus we can show profile information of the Thalia user in the summary admin for you to use without any extra consent.

Resolving patch:
diff --git a/website/education/admin.py b/website/education/admin.py
--- a/website/education/admin.py
+++ b/website/education/admin.py
@@ -8,8 +8,8 @@
 from django.utils.translation import gettext_lazy as _
 
 from utils.translation import TranslatedModelAdmin
-
 from . import models
+from .forms import SummaryAdminForm
 
 admin.site.register(models.Category)
 
@@ -106,6 +106,7 @@ class SummaryAdmin(TranslatedModelAdmin):
         "course__name_en",
     )
     actions = ["accept", "reject", "reset_download_count", "download_csv"]
+    form = SummaryAdminForm
 
     def accept(self, request, queryset):
         queryset.update(accepted=True)
diff --git a/website/education/forms.py b/website/education/forms.py
--- a/website/education/forms.py
+++ b/website/education/forms.py
@@ -9,8 +9,10 @@
     ModelForm,
     SelectDateWidget,
     TypedChoiceField,
+    CharField,
 )
 from django.utils import timezone
+from django.utils.translation import gettext_lazy as _
 
 from utils.snippets import datetime_to_lectureyear
 from .models import Course, Exam, Summary
@@ -57,3 +59,26 @@ class AddSummaryForm(ModelForm):
     class Meta:
         model = Summary
         fields = ("name", "year", "language", "file", "course", "author")
+
+
+class SummaryAdminForm(ModelForm):
+    """
+    Custom form for summaries so that we can show more data in the admin
+    """
+
+    def __init__(self, data=None, files=None, **kwargs):
+        super().__init__(data, files, **kwargs)
+        obj = kwargs.get("instance", None)
+        if not obj:
+            self.fields["phone"].widget = self.fields["phone"].hidden_widget()
+            self.fields["email"].widget = self.fields["email"].hidden_widget()
+        else:
+            self.fields["phone"].initial = obj.uploader.profile.phone_number
+            self.fields["email"].initial = obj.uploader.email
+
+    phone = CharField(label=_("Uploader phone"), disabled=True, required=False)
+    email = CharField(label=_("Uploader email"), disabled=True, required=False)
+
+    class Meta:
+        model = Summary
+        fields = "__all__"


Test patch: