Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
revert unintended change
  • Loading branch information
asadali145 committed Dec 2, 2024
1 parent 5eabdca commit 85b1c00
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cms/migrations/0073_alter_certificatepage_ceus.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Generated by Django 4.2.16 on 2024-11-06 06:35
# Generated by Django 4.2.16 on 2024-12-02 07:22

from decimal import Decimal

import django.core.validators
from django.db import migrations, models


Expand All @@ -18,6 +21,7 @@ class Migration(migrations.Migration):
help_text="Optional field for CEU (continuing education unit).",
max_digits=5,
null=True,
validators=[django.core.validators.MinValueValidator(Decimal("0.01"))],
),
),
]
3 changes: 3 additions & 0 deletions cms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import re
from collections import defaultdict
from datetime import datetime, timedelta
from decimal import Decimal
from urllib.parse import urljoin

from django import forms
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.core.validators import MinValueValidator
from django.db import models
from django.db.models import Prefetch, Q, prefetch_related_objects
from django.http.response import Http404
Expand Down Expand Up @@ -2149,6 +2151,7 @@ class PartnerLogoPlacement(models.IntegerChoices):
blank=True,
decimal_places=2,
max_digits=5,
validators=[MinValueValidator(Decimal("0.01"))],
help_text="Optional field for CEU (continuing education unit).",
)

Expand Down
2 changes: 1 addition & 1 deletion courses/sync_external_courses/emeritus_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def __init__(self, emeritus_course_json):
self.format = emeritus_course_json.get("format")
self.category = emeritus_course_json.get("Category", None)
self.image_name = emeritus_course_json.get("image_name", None)
self.CEUs = Decimal(str(emeritus_course_json.get("ceu"))) or None
self.CEUs = Decimal(str(emeritus_course_json.get("ceu") or "0.0")) or None
self.learning_outcomes_list = (
parse_emeritus_data_str(emeritus_course_json.get("learning_outcomes"))
if emeritus_course_json.get("learning_outcomes")
Expand Down

0 comments on commit 85b1c00

Please sign in to comment.