Skip to content

Commit

Permalink
Feat: name+숫자의 경우 name만 가지고 검색하게 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
joy-river committed Oct 4, 2024
1 parent 2ab093f commit cdc2cdc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions KUA/student/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from . import serializers
import string
import random
import re
from django.core.mail import EmailMessage
from django.utils import timezone
from rest_framework.authentication import TokenAuthentication
Expand All @@ -18,6 +19,7 @@
from drf_yasg import openapi
from rest_framework.parsers import MultiPartParser, FormParser


# 이메일 코드 전송 기능


Expand Down Expand Up @@ -543,6 +545,9 @@ def get(self, request, *args, **kwargs):
name = request.query_params.get('name')
tag = request.query_params.get('tag')

if name:
name = re.sub(r'\d+$', '', name) # Remove trailing digits

if name and tag:
try:
image = models.Image.objects.get(name=name, tag=tag)
Expand Down

0 comments on commit cdc2cdc

Please sign in to comment.