Skip to content

Commit

Permalink
Merge pull request #302 from smu-nity/feature/301
Browse files Browse the repository at this point in the history
[BUG] 기이수과목 업데이트 시 포맷 오류 (#301)
  • Loading branch information
hyunmin0317 authored Jan 31, 2024
2 parents 0583c0f + a7e81e2 commit db549a4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
17 changes: 10 additions & 7 deletions core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,16 @@ def course_update(request):
# 기이수과목 추가
subjects = result.body
for sub in subjects:
subject, _ = Subject.objects.get_or_create(number=sub['SBJ_NO'], defaults={'name': sub['SBJ_NM'], 'credit': sub['CDT'], 'dept': '커스텀', 'type': sub['CMP_DIV_NM']})
domain = sub['CULT_ARA_NM']
if domain == '*':
domain = None
if sub['GRD_NM'] != 'F':
if not Course.objects.filter(user=request.user, subject=subject):
Course.objects.create(user=request.user, subject=subject, year=sub['SCH_YEAR'], semester=sub['SMT_NM'], credit=sub['CDT'], type=sub['CMP_DIV_NM'], domain=domain)
try:
subject, _ = Subject.objects.get_or_create(number=sub['SBJ_NO'], defaults={'name': sub['SBJ_NM'], 'credit': sub['CDT'], 'dept': '커스텀', 'type': sub['CMP_DIV_NM']})
domain = sub['CULT_ARA_NM']
if domain == '*':
domain = None
if sub['GRD_NM'] != 'F':
if not Course.objects.filter(user=request.user, subject=subject):
Course.objects.create(user=request.user, subject=subject, year=sub['SCH_YEAR'], semester=sub['SMT_NM'], credit=sub['CDT'], type=sub['CMP_DIV_NM'], domain=domain)
except:
logger.error(f'[ERROR] {sub}')
messages.error(request, '기이수과목이 업데이트 되었습니다.')
return redirect('core:result')
messages.error(request, '⚠️ 샘물 포털 ID/PW를 다시 확인하세요! (Caps Lock 확인)')
Expand Down
4 changes: 2 additions & 2 deletions templates/qna/answer_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</div>
<div class="post_detail__body_container container my-3" style="margin-bottom: 3rem !important;">
<div class="post_detail__body-title border-bottom">
<h4 class="post_detail__title-title my-3 py-2">청원내용</h4>
<h4 class="post_detail__title-title my-3 py-2 h4-font">질문</h4>
</div>
<div class="card my-3">
<div class="card-body">
Expand All @@ -34,7 +34,7 @@ <h4 class="post_detail__title-title my-3 py-2">청원내용</h4>
</div>
</div>
<div class="post_detail__body-title border-bottom">
<h4 class="post_detail__title-title my-3 py-2">청원내용</h4>
<h4 class="post_detail__title-title my-3 py-2 h4-font">답변</h4>
</div>
<form method="post" class="my-3">
{% csrf_token %}
Expand Down

0 comments on commit db549a4

Please sign in to comment.