Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • konstantin/akplanning
  • matedealer/akplanning
  • kif/akplanning
  • mirco/akplanning
  • lordofthevoid/akplanning
  • voidptr/akplanning
  • xayomer/akplanning-fork
  • mollux/akplanning
  • neumantm/akplanning
  • mmarx/akplanning
  • nerf/akplanning
  • felix_bonn/akplanning
  • sebastian.uschmann/akplanning
13 results
Show changes
Commits on Source (5)
  • Benjamin Hättasch's avatar
    Add missing migration for akslot field update · 0f93fa7f
    Benjamin Hättasch authored
    Verbose name of AKSlot.fixed was updated in a previous commit, this migration reflects this change
    0f93fa7f
  • Benjamin Hättasch's avatar
    Do not track changes of AK interest counter · d6f00e09
    Benjamin Hättasch authored
    This fixes #97
    Exclude interest_counter from AK history
    Prevent saving of history record when increasing interest counter
    
    Run the following action after applying the change/migration to remove existing duplicate history records (the ones without changes to tracked fields, hence caused by either saving without changing any field or especially the ones created due to changes of the now ignored interest_counter):
    python manage.py clean_duplicate_history AKModel.ak
    d6f00e09
  • Nadja Geisler's avatar
    Merge branch 'fix-history-interest' into 'main' · 42f4957c
    Nadja Geisler authored
    Do not track changes of AK interest counter
    
    Closes #97
    
    See merge request !86
    42f4957c
  • Benjamin Hättasch's avatar
    Fix API detail views · fd0b8982
    Benjamin Hättasch authored and Nadja Geisler's avatar Nadja Geisler committed
    Previously, the event from the url was not parsed correctly for API endpoints for individual AKs, AKRooms, etc. This led to self.event being None and the queryset being empty, hence the AK, AKRoom etc. could not be found by the API. This fix makes sure, the event is loaded as part of the API initialization for all endpoints and methods.
    fd0b8982
  • Nadja Geisler's avatar
    Merge branch 'fix-api' into 'main' · 4fa3f6f0
    Nadja Geisler authored
    Fix API detail views
    
    See merge request !89
    4fa3f6f0
# Generated by Django 3.1.5 on 2021-01-29 15:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AKModel', '0042_akslot_fixed'),
]
operations = [
migrations.AlterField(
model_name='akslot',
name='fixed',
field=models.BooleanField(default=False, help_text='Length and time of this AK should not be changed', verbose_name='Scheduling fixed'),
),
]
# Generated by Django 3.1.5 on 2021-01-29 15:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('AKModel', '0043_akslot_fixed_improve_verbose_name'),
]
operations = [
migrations.RemoveField(
model_name='historicalak',
name='interest_counter',
),
]
......@@ -233,7 +233,7 @@ class AK(models.Model):
event = models.ForeignKey(to=Event, on_delete=models.CASCADE, verbose_name=_('Event'),
help_text=_('Associated event'))
history = HistoricalRecords()
history = HistoricalRecords(excluded_fields=['interest_counter'])
class Meta:
verbose_name = _('AK')
......@@ -272,7 +272,9 @@ class AK(models.Model):
def increment_interest(self):
self.interest_counter += 1
self.skip_history_when_saving = True
self.save()
del self.skip_history_when_saving
@property
def availabilities(self):
......
......@@ -38,6 +38,11 @@ class EventSlugMixin:
self._load_event()
return super().create(request, *args, **kwargs)
def initial(self, request, *args, **kwargs):
if self.event is None:
self._load_event()
super().initial(request, *args, **kwargs)
def get_context_data(self, *, object_list=None, **kwargs):
context = super().get_context_data(object_list=object_list, **kwargs)
# Add event to context (to make it accessible in templates)
......