Skip to content

Commit

Permalink
Bugfix: set portal-api as staff member (#311)
Browse files Browse the repository at this point in the history
## Changes

- Set portal-api as staff member. Else it doesn't manage to access the
API

## Issue(s)

- #
  • Loading branch information
Gustavo-SF authored Oct 1, 2024
1 parent 129e5a2 commit cbbda1b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 4.2.14 on 2024-10-01 18:09

from django.db import migrations, models

import portal.academy.models


class Migration(migrations.Migration):
dependencies = [
("academy", "0010_grade_on_time"),
]

operations = [
migrations.AlterField(
model_name="grade",
name="notebook",
field=models.FileField(
blank=True, null=True, upload_to=portal.academy.models.notebook_path
),
),
migrations.AlterField(
model_name="grade",
name="score",
field=models.FloatField(blank=True, null=True),
),
]
4 changes: 2 additions & 2 deletions portal/portal/academy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Grade(models.Model):
)
unit = models.ForeignKey(Unit, on_delete=models.CASCADE, related_name="grades")
created = models.DateTimeField(auto_now_add=True)
notebook = models.FileField(upload_to=notebook_path, null=True)
notebook = models.FileField(upload_to=notebook_path, null=True, blank=True)

STATUSES = (
("never-submitted", "Unsubmitted"),
Expand All @@ -71,7 +71,7 @@ class Grade(models.Model):
status = models.CharField(
max_length=1024, choices=STATUSES, default="never-submitted"
)
score = models.FloatField(null=True)
score = models.FloatField(null=True, blank=True)
message = models.TextField(blank=True)
feedback = models.FileField(upload_to=feedback_path, null=True)
on_time = models.BooleanField(default=True)
1 change: 1 addition & 0 deletions portal/portal/grading/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def get_env(self):
grader = get_user_model().objects.create(
username=settings.GRADING_USERNAME,
email="[email protected]",
is_staff=True,
)

# Check if grader already has an auth token
Expand Down

0 comments on commit cbbda1b

Please sign in to comment.