Skip to content

Commit

Permalink
fixup!: fix quality issues and imports
Browse files Browse the repository at this point in the history
  • Loading branch information
xitij2000 committed Nov 27, 2024
1 parent 090a43a commit da0fa90
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 36 deletions.
7 changes: 2 additions & 5 deletions openedx/core/djangoapps/agreements/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@
from django.core.exceptions import ObjectDoesNotExist
from opaque_keys.edx.keys import CourseKey

from openedx.core.djangoapps.agreements.models import IntegritySignature, UserAgreementRecord
from openedx.core.djangoapps.agreements.models import LTIPIISignature
from openedx.core.djangoapps.agreements.models import LTIPIITool
from .data import LTIPIISignatureData
from .data import LTIToolsReceivingPIIData, UserAgreementRecordData
from .data import LTIPIISignatureData, LTIToolsReceivingPIIData, UserAgreementRecordData
from .models import IntegritySignature, LTIPIISignature, LTIPIITool, UserAgreementRecord

log = logging.getLogger(__name__)
User = get_user_model()
Expand Down
4 changes: 2 additions & 2 deletions openedx/core/djangoapps/agreements/data.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""
Public data structures for this app.
"""
from dataclasses import dataclass
from datetime import datetime

import attr
from dataclasses import dataclass

from openedx.core.djangoapps.agreements.models import UserAgreementRecord
from .models import UserAgreementRecord


@attr.s(frozen=True, auto_attribs=True)
Expand Down
3 changes: 2 additions & 1 deletion openedx/core/djangoapps/agreements/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"""
from rest_framework import serializers

from openedx.core.djangoapps.agreements.models import IntegritySignature, LTIPIISignature
from openedx.core.lib.api.serializers import CourseKeyField

from .models import IntegritySignature, LTIPIISignature


class IntegritySignatureSerializer(serializers.ModelSerializer):
"""
Expand Down
21 changes: 10 additions & 11 deletions openedx/core/djangoapps/agreements/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,22 @@
from testfixtures import LogCapture

from common.djangoapps.student.tests.factories import UserFactory
from openedx.core.djangoapps.agreements.api import (
from openedx.core.djangolib.testing.utils import skip_unless_lms
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory

from ..api import (
create_integrity_signature,
create_lti_pii_signature,
create_user_agreement_record,
get_integrity_signature,
get_integrity_signatures_for_course,
get_pii_receiving_lti_tools,
create_lti_pii_signature,
get_lti_pii_signature,
create_user_agreement_record,
get_user_agreements,
get_pii_receiving_lti_tools,
get_user_agreement_record,
get_user_agreements
)
from openedx.core.djangolib.testing.utils import skip_unless_lms
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from ..models import (
LTIPIITool,
)
from ..models import LTIPIITool

LOGGER_NAME = "openedx.core.djangoapps.agreements.api"

Expand Down
15 changes: 8 additions & 7 deletions openedx/core/djangoapps/agreements/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
from rest_framework.test import APITestCase

from common.djangoapps.student.roles import CourseStaffRole
from common.djangoapps.student.tests.factories import UserFactory, AdminFactory
from openedx.core.djangoapps.agreements.api import (
from common.djangoapps.student.tests.factories import AdminFactory, UserFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory

from ..api import (
create_integrity_signature,
create_user_agreement_record,
get_integrity_signatures_for_course,
get_lti_pii_signature, create_user_agreement_record
get_lti_pii_signature
)
from openedx.core.djangolib.testing.utils import skip_unless_lms
from xmodule.modulestore.tests.django_utils import \
ModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore.tests.factories import CourseFactory # lint-amnesty, pylint: disable=wrong-import-order


@skip_unless_lms
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/agreements/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

from django.conf import settings
from django.urls import re_path, path
from django.urls import path, re_path

from .views import IntegritySignatureView, LTIPIISignatureView, UserAgreementsView

Expand Down
19 changes: 10 additions & 9 deletions openedx/core/djangoapps/agreements/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@
"""

import edx_api_doc_tools as apidocs
from django.conf import settings
from django import forms
from django.conf import settings
from drf_yasg import openapi
from opaque_keys.edx.keys import CourseKey
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from opaque_keys.edx.keys import CourseKey

from rest_framework.response import Response
from rest_framework.views import APIView

from common.djangoapps.student import auth
from common.djangoapps.student.roles import CourseStaffRole
from openedx.core.djangoapps.agreements.api import (

from .api import (
create_integrity_signature,
create_lti_pii_signature,
get_integrity_signature, get_user_agreement_record, create_user_agreement_record,
create_user_agreement_record,
get_integrity_signature,
get_user_agreement_record
)
from openedx.core.djangoapps.agreements.serializers import IntegritySignatureSerializer, LTIPIISignatureSerializer, \
UserAgreementsSerializer
from .serializers import IntegritySignatureSerializer, LTIPIISignatureSerializer, UserAgreementsSerializer


def is_user_course_or_global_staff(user, course_id):
Expand Down

0 comments on commit da0fa90

Please sign in to comment.