Compare commits

...

2 Commits

Author SHA1 Message Date
Joshua Rubingh 2fa124f529 Change schedule sorting. Date first 2020-05-18 12:19:15 +02:00
Joshua Rubingh 5ebba78346 Store error message in DB 2020-05-18 12:19:01 +02:00
2 changed files with 2 additions and 3 deletions

View File

@ -6,7 +6,7 @@ from .models import Schedule
@admin.register(Schedule)
class ScheduleAdmin(admin.ModelAdmin):
list_display = ('name', 'employee', 'email', 'created_at', 'processed')
ordering = ('name', 'created_at')
ordering = ('created_at', 'name',)
search_fields = ('name', 'email')
def processed(self,obj):

View File

@ -31,8 +31,7 @@ def new_or_update_study(request, schedule = None):
try:
new_schedule.planning_source = json.loads(schedule_form.cleaned_data['json'])
except json.JSONDecodeError as ex:
# For now, sorry, ignore
pass
new_schedule.planning_source = json.loads(json.dumps({'error': str(ex)}))
new_schedule.employee = request.user.employee
new_schedule.name = schedule_form.cleaned_data['name']