Skip to content

Commit

Permalink
Merge branch 'refactor/link-modal' of https://github.com/makeplane/plane
Browse files Browse the repository at this point in the history
 into refactor/link-modal
  • Loading branch information
aaryan610 committed Sep 6, 2024
2 parents 6078ac6 + 92f7fd5 commit ec5a212
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
17 changes: 17 additions & 0 deletions apiserver/plane/api/serializers/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
from .state import StateLiteSerializer
from .user import UserLiteSerializer

# Django imports
from django.core.exceptions import ValidationError
from django.core.validators import URLValidator

class IssueSerializer(BaseSerializer):
assignees = serializers.ListField(
Expand Down Expand Up @@ -312,6 +315,20 @@ class Meta:
"created_at",
"updated_at",
]

Check notice on line 318 in apiserver/plane/api/serializers/issue.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

apiserver/plane/api/serializers/issue.py#L318

Trailing whitespace
def validate_url(self, value):
# Check URL format
validate_url = URLValidator()
try:
validate_url(value)
except ValidationError:
raise serializers.ValidationError("Invalid URL format.")

# Check URL scheme
if not value.startswith(("http://", "https://")):
raise serializers.ValidationError("Invalid URL scheme.")

return value

# Validation if url already exists
def create(self, validated_data):
Expand Down
3 changes: 0 additions & 3 deletions apiserver/plane/app/serializers/issue.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Python Imports
import re

# Django imports
from django.utils import timezone
from django.core.validators import URLValidator
Expand Down
3 changes: 0 additions & 3 deletions apiserver/plane/app/serializers/module.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Python Imports
import re

# Third Party imports
from rest_framework import serializers

Expand Down

0 comments on commit ec5a212

Please sign in to comment.