internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: Mailu/Mailu

Issue:
rethink rspamd's overrides
Currently any override put in rspamd's folder will replace Mailu's default config.

This may disable functionality (anti-spoof, oletools, ...) and doesn't make upgrades easy.

We can probably do better.


Discussion:

Resolving patch:
diff --git a/core/rspamd/start.py b/core/rspamd/start.py
--- a/core/rspamd/start.py
+++ b/core/rspamd/start.py
@@ -4,6 +4,7 @@
 import glob
 import logging as log
 import requests
+import shutil
 import sys
 import time
 from socrate import system,conf
@@ -13,8 +14,14 @@
 
 # Actual startup script
 
+config_files = []
 for rspamd_file in glob.glob("/conf/*"):
     conf.jinja(rspamd_file, os.environ, os.path.join("/etc/rspamd/local.d", os.path.basename(rspamd_file)))
+    config_files.append(os.path.basename(rspamd_file))
+
+for override_file in glob.glob("/overrides/*"):
+    if os.path.basename(override_file) not in config_files:
+        shutil.copyfile(override_file, os.path.join("/etc/rspamd/local.d", os.path.basename(override_file)))
 
 # Admin may not be up just yet
 healthcheck = f'http://{os.environ["ADMIN_ADDRESS"]}/internal/rspamd/local_domains'


Test patch:
Repository: Mailu/Mailu

Issue:
SCAN_MACROS is incorrect case in Rspamd configs
In Mailu/core/rspamd/conf/external_services.conf, the first line is '{% if SCAN_MACROS == 'True' %}'. It is also the same in external_services_group.conf, note the capital 'T' in 'True'. When the mailu.env is generated, it generates SCAN_MACROS=true, i.e . all lowercase. Thus, in order to enable oletools, one must put SCAN_MACROS=True in environment file. I'm not sure what other items are reliant on SCAN_MACROS, but they should be checked as well. 


Discussion:

Resolving patch:
diff --git a/core/rspamd/start.py b/core/rspamd/start.py
--- a/core/rspamd/start.py
+++ b/core/rspamd/start.py
@@ -9,13 +9,13 @@
 import time
 from socrate import system,conf
 
-system.set_env()
+env = system.set_env()
 
 # Actual startup script
 
 config_files = []
 for rspamd_file in glob.glob("/conf/*"):
-    conf.jinja(rspamd_file, os.environ, os.path.join("/etc/rspamd/local.d", os.path.basename(rspamd_file)))
+    conf.jinja(rspamd_file, env, os.path.join("/etc/rspamd/local.d", os.path.basename(rspamd_file)))
     config_files.append(os.path.basename(rspamd_file))
 
 for override_file in glob.glob("/overrides/*"):
@@ -23,7 +23,7 @@
         shutil.copyfile(override_file, os.path.join("/etc/rspamd/local.d", os.path.basename(override_file)))
 
 # Admin may not be up just yet
-healthcheck = f'http://{os.environ["ADMIN_ADDRESS"]}/internal/rspamd/local_domains'
+healthcheck = f'http://{env["ADMIN_ADDRESS"]}/internal/rspamd/local_domains'
 while True:
     time.sleep(1)
     try:


Test patch:
Repository: Mailu/Mailu

Issue:
FTS doesn't perform OCR on attachments for keyword extraction
If one send a PDF composed of images, no keywords will be extracted/indexed.

To fix that, we could do some OCR:
- https://github.com/tesseract-ocr/tesseract

or if we want to get fancy, something like
- https://github.com/JaidedAI/EasyOCR

Or the built-in integration with
- https://tika.apache.org/
There is a security argument going for that option: it's written in java (memory  safe language) and would remove the need for decode2text and friends.

This is a follow-up to #2184 and #2972


Discussion:

Resolving patch:
diff --git a/core/admin/mailu/configuration.py b/core/admin/mailu/configuration.py
--- a/core/admin/mailu/configuration.py
+++ b/core/admin/mailu/configuration.py
@@ -75,6 +75,8 @@
     'API': False,
     'WEB_API': '/api',
     'API_TOKEN': None,
+    'FULL_TEXT_SEARCH': 'en',
+    'FULL_TEXT_SEARCH_ATTACHMENTS': False,
     'LOG_LEVEL': 'INFO',
     'SESSION_KEY_BITS': 128,
     'SESSION_TIMEOUT': 3600,


Test patch:
Repository: Mailu/Mailu

Issue:
Add quota_bytes_used on UserGet object API
## Environment & Version

### Environment

- [x] docker compose
- [ ] kubernetes
- [ ] docker swarm

### Version

- Version: `2.0`

## Description
Hello,

Can you add quota_bytes_used on UserGet object API ?



Discussion:

Resolving patch:
diff --git a/core/admin/mailu/api/v1/user.py b/core/admin/mailu/api/v1/user.py
--- a/core/admin/mailu/api/v1/user.py
+++ b/core/admin/mailu/api/v1/user.py
@@ -14,6 +14,7 @@
     'password': fields.String(description="Hash of the user's password; Example='$bcrypt-sha256$v=2,t=2b,r=12$fmsAdJbYAD1gGQIE5nfJq.$zLkQUEs2XZfTpAEpcix/1k5UTNPm0jO'"),
     'comment': fields.String(description='A description for the user. This description is shown on the Users page', example='my comment'),
     'quota_bytes': fields.Integer(description='The maximum quota for the user’s email box in bytes', example='1000000000'),
+    'quota_bytes_used': fields.Integer(description='The size of the user’s email box in bytes', example='5000000'),
     'global_admin': fields.Boolean(description='Make the user a global administrator'),
     'enabled': fields.Boolean(description='Enable the user. When an user is disabled, the user is unable to login to the Admin GUI or webmail or access his email via IMAP/POP3 or send mail'),
     'change_pw_next_login': fields.Boolean(description='Force the user to change their password at next login'),


Test patch:
Repository: Mailu/Mailu

Issue:
Validation of redirect address in UI 
There are several CMSs that require the forwarding address to be specified partially in uppercase. Validation does not allow this.

![изображение](https://github.com/Mailu/Mailu/assets/8946023/0ea396d9-dc7b-41d9-b596-2dc71847842f)

![изображение](https://github.com/Mailu/Mailu/assets/8946023/01e43804-5486-4e72-983a-ab4a85e2c4bb)

```
grep MAILU_VERSION docker-compose.yml mailu.env
docker-compose.yml:    image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}nginx:${MAILU_VERSION:-2.0}
docker-compose.yml:    image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}unbound:${MAILU_VERSION:-2.0}
docker-compose.yml:    image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}admin:${MAILU_VERSION:-2.0}
docker-compose.yml:    image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}dovecot:${MAILU_VERSION:-2.0}
docker-compose.yml:    image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}postfix:${MAILU_VERSION:-2.0}
docker-compose.yml:    image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}oletools:${MAILU_VERSION:-2.0}
docker-compose.yml:    image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}rspamd:${MAILU_VERSION:-2.0}
docker-compose.yml:    image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}radicale:${MAILU_VERSION:-2.0}
docker-compose.yml:    image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}fetchmail:${MAILU_VERSION:-2.0}
docker-compose.yml:    image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}webmail:${MAILU_VERSION:-2.0}
```



Discussion:

Resolving patch:
diff --git a/core/admin/mailu/ui/forms.py b/core/admin/mailu/ui/forms.py
--- a/core/admin/mailu/ui/forms.py
+++ b/core/admin/mailu/ui/forms.py
@@ -38,7 +38,7 @@ def __init__(self,message=_('Invalid email address.')):
         self.message = message
 
     def __call__(self, form, field):
-        pattern = re.compile(r'^([_a-z0-9\-\+]+)(\.[_a-z0-9\-\+]+)*@([a-z0-9\-]{1,}\.)*([a-z]{1,})(,([_a-z0-9\-\+]+)(\.[_a-z0-9\-\+]+)*@([a-z0-9\-]{1,}\.)*([a-z]{2,}))*$')
+        pattern = re.compile(r'^([_a-z0-9\-\+]+)(\.[_a-z0-9\-\+]+)*@([a-z0-9\-]{1,}\.)*([a-z]{1,})(,([_a-z0-9\-\+]+)(\.[_a-z0-9\-\+]+)*@([a-z0-9\-]{1,}\.)*([a-z]{2,}))*$', re.IGNORECASE)
         if not pattern.match(field.data.replace(" ", "")):
             raise validators.ValidationError(self.message)
 


Test patch:
Repository: webkom/lego

Issue:
Add shell pluss and django extensions



Discussion:
:+1: 


Resolving patch:
diff --git a/lego/settings/base.py b/lego/settings/base.py
--- a/lego/settings/base.py
+++ b/lego/settings/base.py
@@ -6,6 +6,8 @@
 
 TESTING = 'test' in sys.argv  # Check if manage.py test has been run
 
+SHELL_PLUS = "ipython"
+
 DEBUG = True
 TEMPLATE_DEBUG = True
 ALLOWED_HOSTS = []
@@ -20,6 +22,8 @@
     'django.contrib.messages',
     'django.contrib.staticfiles',
 
+    'django_extensions',
+
     'oauth2_provider',
     'rest_framework',
 


Test patch:
Repository: webkom/lego

Issue:
Semesters are missing from interest form e-mails
It seems that the signal to the feed handler is triggered before the semesters are stored on the model? The semesters show up when viewing the interest later, but are not present when the email is generated. Could this have happened after the changes to semesters, @odinuge?

A quick fix would be to send the email during creation, instead of in the feed handler.


Discussion:
The reason is that many-to-many relations (eg. semesters in companyInterest) are created after the `post_save` hook that is use to send notifications via the feed. It shouldn't be any problem to use the `m2m-changed` signal instead (fired when m2m-relations are saved/changed) - but it would require some changes in the general feed handling flow.

https://docs.djangoproject.com/en/dev/ref/signals/#m2m-changed
Why did this work previously then? :thinking: 

Resolving patch:
diff --git a/lego/apps/companies/serializers.py b/lego/apps/companies/serializers.py
--- a/lego/apps/companies/serializers.py
+++ b/lego/apps/companies/serializers.py
@@ -4,6 +4,7 @@
 from lego.apps.comments.serializers import CommentSerializer
 from lego.apps.companies.models import (Company, CompanyContact, CompanyFile, CompanyInterest,
                                         Semester, SemesterStatus)
+from lego.apps.feed.registry import get_handler
 from lego.apps.files.fields import FileField, ImageField
 from lego.apps.users.fields import PublicUserField
 from lego.apps.users.models import User
@@ -126,6 +127,15 @@ class Meta:
         fields = ('id', 'company_name', 'contact_person', 'mail', 'semesters', 'events',
                   'other_offers', 'comment')
 
+    def create(self, validated_data):
+        semesters = validated_data.pop('semesters')
+        company_interest = CompanyInterest.objects.create(**validated_data)
+        company_interest.semesters.add(*semesters)
+        company_interest.save()
+        get_handler(CompanyInterest).handle_interest(company_interest)
+
+        return company_interest
+
 
 class CompanyInterestListSerializer(serializers.ModelSerializer):
     class Meta:
diff --git a/lego/apps/feed/feed_handlers/company_interest_handler.py b/lego/apps/feed/feed_handlers/company_interest_handler.py
--- a/lego/apps/feed/feed_handlers/company_interest_handler.py
+++ b/lego/apps/feed/feed_handlers/company_interest_handler.py
@@ -14,7 +14,7 @@ class CompanyInterestHandler(BaseHandler):
     model = CompanyInterest
     manager = feed_manager
 
-    def handle_create(self, company_interest):
+    def handle_interest(self, company_interest):
 
         activity = Activity(
             actor=company_interest,
@@ -38,6 +38,9 @@ def handle_create(self, company_interest):
             )
             notification.notify()
 
+    def handle_create(self, company_interest):
+        pass
+
     def handle_update(self, company_interest):
         pass
 


Test patch:
Repository: webkom/lego

Issue:
Wrong penalty count in email
The counter in the penalty email is still wrong:

![screenshot from 2018-02-02 13-43-18](https://user-images.githubusercontent.com/1467188/35733820-208df2e4-081f-11e8-9903-3767cfedd43d.png)



Discussion:
Unable to reproduce locally, but happens consistently in prod :thinking: 

Resolving patch:
diff --git a/lego/apps/feed/feed_handlers/penalty_handler.py b/lego/apps/feed/feed_handlers/penalty_handler.py
--- a/lego/apps/feed/feed_handlers/penalty_handler.py
+++ b/lego/apps/feed/feed_handlers/penalty_handler.py
@@ -18,7 +18,6 @@ def get_activity(self, penalty):
             time=penalty.created_at, extra_context={
                 'reason': penalty.reason,
                 'weight': penalty.weight,
-                'total': penalty.user.number_of_penalties()
             }
         )
 
diff --git a/lego/apps/users/notifications.py b/lego/apps/users/notifications.py
--- a/lego/apps/users/notifications.py
+++ b/lego/apps/users/notifications.py
@@ -16,7 +16,6 @@ def generate_mail(self):
                 'weight': penalty.weight,
                 'event': penalty.source_event.title,
                 'reason': penalty.reason,
-                'total': self.user.number_of_penalties()
             },
             subject=f'Du har fått en ny prikk',
             plain_template='users/email/penalty.txt',


Test patch:
diff --git a/lego/apps/feed/tests/test_penalty_handler.py b/lego/apps/feed/tests/test_penalty_handler.py
--- a/lego/apps/feed/tests/test_penalty_handler.py
+++ b/lego/apps/feed/tests/test_penalty_handler.py
@@ -36,7 +36,5 @@ def test_extra_content(self):
         activity = self.all_activities(NotificationFeed(self.user.id))[0]
         self.assertIn('reason', activity.extra_context)
         self.assertIn('weight', activity.extra_context)
-        self.assertIn('total', activity.extra_context)
         self.assertEqual(activity.extra_context['reason'], self.penalty.reason)
         self.assertEqual(activity.extra_context['weight'], self.penalty.weight)
-        self.assertEqual(activity.extra_context['total'], self.user.number_of_penalties())
Repository: webkom/lego

Issue:
Add user id to metadata related to all data/actions in stripe



Discussion:

Resolving patch:
diff --git a/lego/apps/events/tasks.py b/lego/apps/events/tasks.py
--- a/lego/apps/events/tasks.py
+++ b/lego/apps/events/tasks.py
@@ -127,8 +127,9 @@ def async_payment(self, registration_id, token, logger_context=None):
             amount=event.get_price(self.registration.user), currency='NOK', source=token,
             description=event.slug, metadata={
                 'EVENT_ID': event.id,
+                'USER_ID': self.registration.user.id,
                 'USER': self.registration.user.full_name,
-                'EMAIL': self.registration.user.email
+                'EMAIL': self.registration.user.email,
             }
         )
         log.info('stripe_payment_success', registration_id=self.registration.id)


Test patch:
Repository: webkom/lego

Issue:
Create filter by company in joblistings
Currently `https://apiserver/api/v1/joblistings/?company=id` returns all active joblistings


Discussion:

Resolving patch:
diff --git a/lego/apps/joblistings/filters.py b/lego/apps/joblistings/filters.py
new file mode 100644
--- /dev/null
+++ b/lego/apps/joblistings/filters.py
@@ -0,0 +1,9 @@
+from django_filters import FilterSet
+
+from lego.apps.joblistings.models import Joblisting
+
+
+class JoblistingFilterSet(FilterSet):
+    class Meta:
+        model = Joblisting
+        fields = ('company', )
diff --git a/lego/apps/joblistings/views.py b/lego/apps/joblistings/views.py
--- a/lego/apps/joblistings/views.py
+++ b/lego/apps/joblistings/views.py
@@ -1,6 +1,7 @@
 from django.utils import timezone
 from rest_framework import viewsets
 
+from lego.apps.joblistings.filters import JoblistingFilterSet
 from lego.apps.joblistings.models import Joblisting
 from lego.apps.joblistings.serializer import (
     JoblistingCreateAndUpdateSerializer, JoblistingDetailedSerializer, JoblistingSerializer
@@ -10,6 +11,7 @@
 
 class JoblistingViewSet(AllowedPermissionsMixin, viewsets.ModelViewSet):
     pagination_class = None
+    filter_class = JoblistingFilterSet
 
     def get_serializer_class(self):
         if self.action in ['create', 'update', 'partial_update']:


Test patch:
Repository: webkom/lego

Issue:
Fix event registration pool overflow
Proof of concept here: https://github.com/webkom/lego/pull/1321/files


Discussion:

Resolving patch:
diff --git a/lego/apps/events/models.py b/lego/apps/events/models.py
--- a/lego/apps/events/models.py
+++ b/lego/apps/events/models.py
@@ -443,6 +443,8 @@ def rebalance_pool(self, from_pool, to_pool):
         to_pool_permissions = to_pool.permission_groups.all()
         bumped = False
         for old_registration in self.registrations.filter(pool=from_pool):
+            if to_pool.is_full:
+                break
             moveable = False
             user_groups = old_registration.user.all_groups
             for group in to_pool_permissions:


Test patch:
diff --git a/lego/apps/events/tests/test_registrations.py b/lego/apps/events/tests/test_registrations.py
--- a/lego/apps/events/tests/test_registrations.py
+++ b/lego/apps/events/tests/test_registrations.py
@@ -799,6 +799,39 @@ def test_rebalance_pool_method(self):
         self.assertEqual(abakus_pool.registrations.count(), 1)
         self.assertEqual(webkom_pool.registrations.count(), 2)
 
+    def test_rebalance_pool_method_should_not_overflow(self):
+        """Test rebalancing method by moving registered user's pool to fit waiting list user"""
+        event = Event.objects.get(title="POOLS_NO_REGISTRATIONS")
+        abakus_pool = event.pools.get(name="Abakusmember")
+        webkom_pool = event.pools.get(name="Webkom")
+        users = get_dummy_users(6)
+        for user in users:
+            AbakusGroup.objects.get(name="Abakus").add_user(user)
+
+        webkom_users = users[:3]
+        abakus_users = users[3:]
+
+        for user in webkom_users:
+            registration = Registration.objects.get_or_create(event=event, user=user)[0]
+            event.register(registration)
+
+        self.assertEqual(abakus_pool.registrations.count(), 3)
+        self.assertEqual(webkom_pool.registrations.count(), 0)
+
+        for user in abakus_users:
+            registration = Registration.objects.get_or_create(event=event, user=user)[0]
+            event.register(registration)
+
+        self.assertEqual(abakus_pool.registrations.count(), 3)
+        self.assertEqual(webkom_pool.registrations.count(), 0)
+
+        for user in webkom_users:
+            AbakusGroup.objects.get(name="Webkom").add_user(user)
+
+        event.bump_on_pool_creation_or_expansion()
+        self.assertEqual(abakus_pool.registrations.count(), 3)  # Abakus-pool has size 3
+        self.assertEqual(webkom_pool.registrations.count(), 2)  # Webkom-pool has size 2
+
     def test_cant_register_after_event_has_started(self):
         """Test that a user cannot register after the event has started."""
         event = Event.objects.get(title="POOLS_NO_REGISTRATIONS")
Repository: webkom/lego

Issue:
In profile page, split my upcoming events into wait list and confirmed spot
A little improvement


Discussion:

Resolving patch:
diff --git a/lego/apps/events/serializers/events.py b/lego/apps/events/serializers/events.py
--- a/lego/apps/events/serializers/events.py
+++ b/lego/apps/events/serializers/events.py
@@ -145,6 +145,18 @@ def get_attended_count(self, event):
         return event.registrations.filter(presence=PRESENT).count()
 
 
+class EventUserRegSerializer(EventReadSerializer):
+    user_reg = serializers.SerializerMethodField()
+
+    class Meta:
+        model = Event
+        fields = EventReadSerializer.Meta.fields + ("user_reg",)
+        read_only = True
+
+    def get_user_reg(self, event):
+        return RegistrationReadSerializer(event.user_reg[0]).data
+
+
 class EventReadUserDetailedSerializer(EventReadDetailedSerializer):
     """ User specfic event serializer that appends data based on request.user """
 
diff --git a/lego/apps/events/views.py b/lego/apps/events/views.py
--- a/lego/apps/events/views.py
+++ b/lego/apps/events/views.py
@@ -28,6 +28,7 @@
     EventReadAuthUserDetailedSerializer,
     EventReadSerializer,
     EventReadUserDetailedSerializer,
+    EventUserRegSerializer,
     populate_event_registration_users_with_grade,
 )
 from lego.apps.events.serializers.pools import PoolCreateAndUpdateSerializer
@@ -192,14 +193,33 @@ def payment(self, request, *args, **kwargs):
 
     @decorators.action(
         detail=False,
-        serializer_class=EventReadSerializer,
+        serializer_class=EventUserRegSerializer,
         permission_classes=[permissions.IsAuthenticated],
     )
     def upcoming(self, request):
-        queryset = self.get_queryset().filter(
-            registrations__status=constants.SUCCESS_REGISTER,
-            registrations__user=request.user,
-            start_time__gt=timezone.now(),
+        queryset = (
+            self.get_queryset()
+            .filter(
+                registrations__status=constants.SUCCESS_REGISTER,
+                registrations__user=request.user,
+                start_time__gt=timezone.now(),
+            )
+            .prefetch_related(
+                Prefetch(
+                    "registrations",
+                    queryset=Registration.objects.filter(
+                        user=request.user
+                    ).select_related("user", "pool"),
+                    to_attr="user_reg",
+                ),
+                Prefetch(
+                    "pools",
+                    queryset=Pool.objects.filter(
+                        permission_groups__in=self.request.user.all_groups
+                    ),
+                    to_attr="possible_pools",
+                ),
+            )
         )
         serializer = self.get_serializer(queryset, many=True)
         return Response(serializer.data)


Test patch:
Repository: webkom/lego

Issue:
[Doppins] Upgrade dependency channels to ==2.1.6
Hi!

A new version was just released of `channels`, so [Doppins](https://doppins.com)
has upgraded your project's dependency ranges.

Make sure that it doesn't break anything, and happy merging! :shipit:

---
### Upgraded channels from `==2.1.5` to `==2.1.6`




Discussion:

Resolving patch:
diff --git a/lego/apps/search/backends/elasticsearch.py b/lego/apps/search/backends/elasticsearch.py
--- a/lego/apps/search/backends/elasticsearch.py
+++ b/lego/apps/search/backends/elasticsearch.py
@@ -14,10 +14,10 @@ class ElasticsearchBackend(SearchBacked):
     connection = None
 
     def set_up(self):
-        hosts = getattr(settings, "ELASTICSEARCH", None)
-        if hosts:
+        host = getattr(settings, "ELASTICSEARCH", None)
+        if host:
             self.connection = Elasticsearch(
-                hosts=settings.ELASTICSEARCH, ca_certs=certifi.where()
+                settings.ELASTICSEARCH, ca_certs=certifi.where()
             )
 
     def _index_name(self):
diff --git a/lego/settings/development.py b/lego/settings/development.py
--- a/lego/settings/development.py
+++ b/lego/settings/development.py
@@ -76,7 +76,7 @@
 CELERY_TASK_ALWAYS_EAGER = True
 CELERY_EAGER_PROPAGATES_EXCEPTIONS = True
 
-ELASTICSEARCH = [{"host": "127.0.0.1"}]
+ELASTICSEARCH = "127.0.0.1"
 
 LDAP_SERVER = "127.0.0.1:389"
 LDAP_USER = "cn=admin,dc=abakus,dc=no"
diff --git a/lego/settings/production.py b/lego/settings/production.py
--- a/lego/settings/production.py
+++ b/lego/settings/production.py
@@ -63,7 +63,7 @@
 CHANNEL_LAYERS["default"]["CONFIG"] = {"hosts": [env("CHANNELS_REDIS_URL")]}
 
 # Elasticsearch
-ELASTICSEARCH = [{"host": env("ELASTICSEARCH_HOST")}]
+ELASTICSEARCH = env("ELASTICSEARCH_HOST")
 SEARCH_INDEX = env("SEARCH_INDEX", default="lego-search")
 
 # Stripe


Test patch:
diff --git a/lego/settings/test.py b/lego/settings/test.py
--- a/lego/settings/test.py
+++ b/lego/settings/test.py
@@ -52,7 +52,7 @@
     }
 }
 
-ELASTICSEARCH = [{"host": "localhost"}]
+ELASTICSEARCH = "localhost"
 
 CELERY_TASK_ALWAYS_EAGER = True
 CELERY_EAGER_PROPAGATES_EXCEPTIONS = True
Repository: webkom/lego

Issue:
Add end_time of an event when getting all events with get request
I want to be able to get the end time of an event when getting all events. I know I can get the end time when getting a specific event, but it is a bit cumbersome.


Discussion:

Resolving patch:
diff --git a/lego/apps/events/serializers/events.py b/lego/apps/events/serializers/events.py
--- a/lego/apps/events/serializers/events.py
+++ b/lego/apps/events/serializers/events.py
@@ -62,6 +62,7 @@ class Meta:
             "event_type",
             "location",
             "start_time",
+            "end_time",
             "thumbnail",
             "total_capacity",
             "company",


Test patch: