Skip to content

Commit

Permalink
fix: [AXM-1249] small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kyrylo-kh committed Dec 23, 2024
1 parent 22d1a08 commit e666ecb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions credentials/apps/badges/accredible/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def sync_groups(self, site_id: int) -> int:
"description": raw_group.get("course_description"),
"icon": self.fetch_design_image(raw_group.get("primary_design_id")),
"created": raw_group.get("created_at"),
"state": AccredibleGroup.STATES.active,
},
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.17 on 2024-12-23 15:08

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("badges", "0002_accredibleapiconfig_accrediblebadge_and_more"),
]

operations = [
migrations.AlterField(
model_name="accredibleapiconfig",
name="name",
field=models.CharField(help_text="Accredible API configuration name.", max_length=255, null=True),
),
]
5 changes: 3 additions & 2 deletions credentials/apps/badges/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def groups(self):

return {
group: BadgeRequirement.is_group_fulfilled(group=group, template=self.template, username=self.username)
for group in self.template.groups
for group in getattr(self.template, "groups", [])
}

@property
Expand Down Expand Up @@ -683,7 +683,7 @@ class AccredibleAPIConfig(TimeStampedModel):
Accredible API configuration.
"""

name = models.CharField(max_length=255, help_text=_("Accredible API configuration name."), null=True, blank=True)
name = models.CharField(max_length=255, help_text=_("Accredible API configuration name."), null=True, blank=False)
api_key = models.CharField(max_length=255, help_text=_("Accredible API key."))

@classmethod
Expand All @@ -693,6 +693,7 @@ def get_all_api_config_ids(cls):
"""
return list(cls.objects.values_list("id", flat=True))


class AccredibleGroup(BadgeTemplate):
"""
Accredible badge group credential type.
Expand Down

0 comments on commit e666ecb

Please sign in to comment.