zmiana w nazwach w modelach na snake_case (ujednolicenie)
All checks were successful
continuous-integration/drone Build is passing
All checks were successful
continuous-integration/drone Build is passing
This commit is contained in:
parent
8b42b83fa1
commit
1549d85377
@ -41,8 +41,8 @@ class JobListing(models.Model):
|
||||
expiration_date = models.DateTimeField(null=True, blank=True)
|
||||
image = models.CharField(max_length=255, null=True, blank=True)
|
||||
experience_level = models.CharField(max_length=255, null=True, blank=True)
|
||||
employmentType = models.CharField(max_length=255, null=True, blank=True)
|
||||
workFromHome = models.CharField(max_length=255)
|
||||
employment_type = models.CharField(max_length=255, null=True, blank=True)
|
||||
work_from_home = models.CharField(max_length=255)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
# skillLevels = models.ManyToManyField('SkillLevels', blank=True)
|
||||
anonymous_user_data = models.ForeignKey(AnonymousUserData,
|
||||
|
||||
@ -25,6 +25,8 @@ class MyUserViewSet(viewsets.ModelViewSet):
|
||||
queryset = MyUser.objects.all()
|
||||
serializer_class = MyUserSerializer
|
||||
required_scope = ['main']
|
||||
authentication_classes = [] ### test only - to be changed
|
||||
permission_classes = [] ###
|
||||
# # permission_classes = [permissions.IsAuthenticated]
|
||||
|
||||
class JobListingViewSet(viewsets.ModelViewSet):
|
||||
@ -33,7 +35,8 @@ class JobListingViewSet(viewsets.ModelViewSet):
|
||||
queryset = JobListing.objects.all()
|
||||
serializer_class = JobListingSerializer
|
||||
required_scope = ['main']
|
||||
|
||||
authentication_classes = []
|
||||
permission_classes = []
|
||||
# # permission_classes = [permissions.IsAuthenticatedOrReadOnly]
|
||||
|
||||
def perform_create(self, serializer):
|
||||
@ -60,6 +63,8 @@ class SkillLevelsViewSet(viewsets.ModelViewSet):
|
||||
queryset = SkillLevels.objects.all()
|
||||
serializer_class = SkillLevelsSerializer
|
||||
required_scope = ['main']
|
||||
authentication_classes = []
|
||||
permission_classes = []
|
||||
|
||||
# # permission_classes = [permissions.IsAuthenticatedOrReadOnly]
|
||||
|
||||
@ -81,7 +86,8 @@ class CompanyLogoViewSet(viewsets.ModelViewSet):
|
||||
queryset = CompanyLogo.objects.all()
|
||||
serializer_class = CompanyLogoSerializer
|
||||
required_scope = ['main']
|
||||
|
||||
authentication_classes = []
|
||||
permission_classes = []
|
||||
|
||||
class SkillViewset(viewsets.ModelViewSet):
|
||||
# authentication_classes = [OAuth2Authentication, authentication.SessionAuthentication]
|
||||
@ -89,36 +95,5 @@ class SkillViewset(viewsets.ModelViewSet):
|
||||
queryset = Skill.objects.all()
|
||||
serializer_class = SkillSerializer
|
||||
required_scope = ['main']
|
||||
|
||||
class GetAuthTokenView(APIView):
|
||||
# authentication_classes = []
|
||||
# permission_classes = []
|
||||
def post(self, request):
|
||||
# print("GET ID")
|
||||
# client_id = settings.REACT_CLIENT_ID
|
||||
# client_secret = settings.REACT_CLIENT_SECRET
|
||||
# print("GET SECRET")
|
||||
# credential = "{0}:{1}".format(client_id, client_secret)
|
||||
# credential_b = base64.b64encode(credential.encode("utf-8")).decode("utf-8")
|
||||
# print(credential_b)
|
||||
headers = {
|
||||
"Cache-Control": "no-cache",
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
}
|
||||
data = {
|
||||
"grant_type": "client_credentials"
|
||||
}
|
||||
print(headers)
|
||||
print("DATA READY")
|
||||
proxies = {
|
||||
"http": "http://tinyproxy-svc:8888",}
|
||||
try:
|
||||
response = requests.post('http://izaac.izaac.pl/o/token/',
|
||||
headers=headers,
|
||||
data=data,
|
||||
proxies=proxies)
|
||||
print(response.json())
|
||||
return Response(response.json())
|
||||
except:
|
||||
print("ERROR")
|
||||
return Response({"error": "error"}, status=status.HTTP_400_BAD_REQUEST)
|
||||
authentication_classes = []
|
||||
permission_classes = []
|
||||
Loading…
x
Reference in New Issue
Block a user