From 63307a83882a8101a6d5194911a6a0f32b7e2953 Mon Sep 17 00:00:00 2001 From: s460930 Date: Tue, 1 Dec 2020 22:49:16 +0100 Subject: [PATCH] SMART-37 implemented registration view --- .../__pycache__/__init__.cpython-38.pyc | Bin 167 -> 167 bytes .../__pycache__/settings.cpython-38.pyc | Bin 3500 -> 3500 bytes .../__pycache__/urls.cpython-38.pyc | Bin 1015 -> 1015 bytes .../__pycache__/wsgi.cpython-38.pyc | Bin 580 -> 580 bytes .../user/__pycache__/__init__.cpython-38.pyc | Bin 176 -> 176 bytes .../app/user/__pycache__/admin.cpython-38.pyc | Bin 217 -> 217 bytes .../user/__pycache__/models.cpython-38.pyc | Bin 2416 -> 2416 bytes .../__pycache__/0001_initial.cpython-38.pyc | Bin 1014 -> 1028 bytes .../0002_auto_20201130_2119.cpython-38.pyc | Bin 530 -> 545 bytes .../__pycache__/__init__.cpython-38.pyc | Bin 187 -> 187 bytes rest-app/smartpicasso/app/user/views.py | 25 ++++++++++++++++-- .../__pycache__/__init__.cpython-38.pyc | Bin 184 -> 184 bytes .../__pycache__/admin.cpython-38.pyc | Bin 225 -> 225 bytes .../__pycache__/models.cpython-38.pyc | Bin 1124 -> 1124 bytes .../__pycache__/0001_initial.cpython-38.pyc | Bin 1055 -> 1055 bytes .../__pycache__/__init__.cpython-38.pyc | Bin 195 -> 195 bytes 16 files changed, 23 insertions(+), 2 deletions(-) diff --git a/rest-app/smartpicasso/__pycache__/__init__.cpython-38.pyc b/rest-app/smartpicasso/__pycache__/__init__.cpython-38.pyc index 012896bbc20f5d4a2a54117c3a8d274e2ed8f6c9..f266be55a92b525670bd494536412d9b5c46ee9b 100644 GIT binary patch delta 19 ZcmZ3^xSWwYl$V!_0SG4a9Gl2J2LLKa1n&R< delta 19 ZcmZ3^xSWwYl$V!_0SNL7j!xvB0{|%U1hD`B diff --git a/rest-app/smartpicasso/__pycache__/settings.cpython-38.pyc b/rest-app/smartpicasso/__pycache__/settings.cpython-38.pyc index 092397f13661cccec3c5de43c5143dd0e5eb6f30..5b5865037fe9425e9bf83e0e5d76b99d6948d776 100644 GIT binary patch delta 19 ZcmZ1@y+)cVl$V!_0SG4aY~)(R3ji$_1egE- delta 19 ZcmZ1@y+)cVl$V!_0SIPQZsc0T3ji$i1djj! diff --git a/rest-app/smartpicasso/__pycache__/urls.cpython-38.pyc b/rest-app/smartpicasso/__pycache__/urls.cpython-38.pyc index b91070ceaba81f431aa2fd768ea100840d2e7b35..74b3fd52bd0832a495c073c74b9c2eb2b89b19cf 100644 GIT binary patch delta 19 Zcmey){+*pGl$V!_0SG4aY~*^&3;;EU1xEk? delta 19 Zcmey){+*pGl$V!_0SK;?Z{&K*3;;H^1$F=c diff --git a/rest-app/smartpicasso/__pycache__/wsgi.cpython-38.pyc b/rest-app/smartpicasso/__pycache__/wsgi.cpython-38.pyc index 4baa4a5ae6837441d900fe45ca887580f1f3b0eb..269351cdcfc2ff197e546f0837801c5067288685 100644 GIT binary patch delta 20 acmX@Ya)gCDl$V!_0SG4a9NWlk$pip1tpx4> delta 20 acmX@Ya)gCDl$V!_0SNL7j&9_(WC8#(83eEZ diff --git a/rest-app/smartpicasso/app/user/__pycache__/__init__.cpython-38.pyc b/rest-app/smartpicasso/app/user/__pycache__/__init__.cpython-38.pyc index 81428760ad4de6ca3747d79c685cf37d3156d47f..7a008fc13de5ed1c5ad00761da70068fc00e5ca8 100644 GIT binary patch delta 19 ZcmdnMxPg&7l$V!_0SG4a9Gl3!6aXug1quKF delta 19 ZcmdnMxPg&7l$V!_0SNL7j!xuW3IHlU1k3;c diff --git a/rest-app/smartpicasso/app/user/__pycache__/admin.cpython-38.pyc b/rest-app/smartpicasso/app/user/__pycache__/admin.cpython-38.pyc index 6218ee92be423cd4c0f009c0106558dcf4e1bdd5..01cd26348969e76516a1d59a4483c163e0a13e48 100644 GIT binary patch delta 19 Zcmcb~c$1Mkl$V!_0SG4a9Gl2}4gfKN1%&_r delta 19 Zcmcb~c$1Mkl$V!_0SNL7j!xu02LLcE1xEk? diff --git a/rest-app/smartpicasso/app/user/__pycache__/models.cpython-38.pyc b/rest-app/smartpicasso/app/user/__pycache__/models.cpython-38.pyc index b3aaace9242176886bcd1e533c65e587c5d749cd..7a0885a1992fa49bbf138578eaa7b11a4409d5c5 100644 GIT binary patch delta 19 Zcmew$^g)O#l$V!_0SG4aY~)Jg1OPPo1kL~e delta 19 Zcmew$^g)O#l$V!_0SK12ZRASh1OPQ<1m6Gv diff --git a/rest-app/smartpicasso/app/user/migrations/__pycache__/0001_initial.cpython-38.pyc b/rest-app/smartpicasso/app/user/migrations/__pycache__/0001_initial.cpython-38.pyc index 5119f86eece0e378c9ed1e26dd37c451de62457e..fccce74770a732773fa9c1f8727fbc1f9a1107c3 100644 GIT binary patch delta 284 zcmeyy-on8b%FD~e00etCAB$&UnaI~xzX-@nWr$)-VTfW%VT@ut#-7j1ou@ z4`$GmxW(z4nO>Awl9`|9HrbgmY4S40O^kw*Bbij$*%C|gb2F1C*D`go=>Yvxq%)a^ fxtLuA$mC#RncTu`C#4P&W&z8g61tP`FiQadNDx3E delta 255 zcmZqS_{Po`%FD~e00j93N8>**PvmQ>p9kcnGDI<^Fhnt>Fh((_GeohZvSzWRFr_f3 zvS)Fmu%s}ju=X;gF{Q8p`J5??K**lL(aQ`J;RK3srE+KSq;LU6xl*`$S%9KEKvCWl zUZ4nH3O`t#08oSv$QSHo1j-A6d0b!~CsT?rggaS*QB;UOMLd{6Q{onlWAY?sJ1I4gAPZOqmC%{| HidhN(PMtXj diff --git a/rest-app/smartpicasso/app/user/migrations/__pycache__/0002_auto_20201130_2119.cpython-38.pyc b/rest-app/smartpicasso/app/user/migrations/__pycache__/0002_auto_20201130_2119.cpython-38.pyc index 1cde8a2dec2561a8ba3094c61c8bac141b00dbc5..34c4c8a626f4a77737187501670febe8e5d44858 100644 GIT binary patch delta 162 zcmbQlvXF&0l$V!_0SNYPJ{Ipek+;Y~4aiAlh+<4(h+;}%jABkNoCDqOJN2= zmR=B_J%u%xL6hwkr*CF@QDRAEexBRJO*)Jm6Ys0Cvn7_~=Vm5PW@a>I;|Cg6#6Q`F sv5s8;$mC#RnY^D-TLU5tmIDzWsaqU2x%nxjIjMHcKwdEuklel#uTX3%84#p#=wUX)mpnV&atyAC7!#3!ng1sRRl_<;J0_$GTY*0F+^9Fxy6YHL6Q d!7?C%A4uHdu*uC&Da}c>V+QhynScZjGXPix9)$n^ diff --git a/rest-app/smartpicasso/app/user/migrations/__pycache__/__init__.cpython-38.pyc b/rest-app/smartpicasso/app/user/migrations/__pycache__/__init__.cpython-38.pyc index e34e9eb8b6ebb15e714d8cd8fc7d57071078ba4c..62d8e5b70e88d3ed03a0201522c41878e50f7972 100644 GIT binary patch delta 19 ZcmdnZxSNqXl$V!_0SG4a9Gl3!0RSy51uFmm delta 19 ZcmdnZxSNqXl$V!_0SNL7j!xv>001l21nmF- diff --git a/rest-app/smartpicasso/app/user/views.py b/rest-app/smartpicasso/app/user/views.py index a303436..ecb0a57 100644 --- a/rest-app/smartpicasso/app/user/views.py +++ b/rest-app/smartpicasso/app/user/views.py @@ -1,9 +1,9 @@ from rest_framework import status -from rest_framework.generics import RetrieveAPIView +from rest_framework.generics import RetrieveAPIView, CreateAPIView from rest_framework.permissions import AllowAny from rest_framework.response import Response -from smartpicasso.app.user.serializers import UserLoginSerializer +from smartpicasso.app.user.serializers import UserLoginSerializer, UserRegistrationSerializer class UserLoginView(RetrieveAPIView): @@ -25,3 +25,24 @@ class UserLoginView(RetrieveAPIView): status_code = status.HTTP_200_OK return Response(response, status=status_code) + + +class UserRegistrationView(CreateAPIView): + """ + View for user registration + """ + permission_classes = (AllowAny,) + serializer_class = UserRegistrationSerializer + + def post(self, request): + serializer = self.serializer_class(data=request.data) + serializer.is_valid(raise_exception=True) + serializer.save() + status_code = status.HTTP_201_CREATED + response = { + 'success': 'True', + 'status_code': status_code, + 'message': 'User registered successfully' + } + + return Response(response, status=status_code) diff --git a/rest-app/smartpicasso/app/user_profile/__pycache__/__init__.cpython-38.pyc b/rest-app/smartpicasso/app/user_profile/__pycache__/__init__.cpython-38.pyc index 90b0343ccc4d3e9778e309b6320731bc96ac7b80..6b25f622f576112f60d3465b4d8354ac09c3b4a4 100644 GIT binary patch delta 19 ZcmdnNxPy^9l$V!_0SG4a9Gl3!762^01tI_d delta 19 ZcmdnNxPy^9l$V!_0SNL7j!xuW3jix;1mpk! diff --git a/rest-app/smartpicasso/app/user_profile/__pycache__/admin.cpython-38.pyc b/rest-app/smartpicasso/app/user_profile/__pycache__/admin.cpython-38.pyc index 1f0e3406b910ba802ec1a8c794a459e4c3f8e00e..08118cc5d5a0f51ce01cebee94ac4fc8b24ff034 100644 GIT binary patch delta 19 ZcmaFJ_>hr1l$V!_0SG4a9Gl2}4FEE#1)Tr@ delta 19 ZcmaFJ_>hr1l$V!_0SNL7j!xvh1^_Ws1z!LF diff --git a/rest-app/smartpicasso/app/user_profile/__pycache__/models.cpython-38.pyc b/rest-app/smartpicasso/app/user_profile/__pycache__/models.cpython-38.pyc index 48150205b2012ba1a9396a13b501d41f5c364aa8..11e4dc95008ce57200a2532838a01292fa9dce43 100644 GIT binary patch delta 20 acmaFD@q~jrl$V!_0SG4a9NWkp$pQd5KLuC- delta 20 acmaFD@q~jrl$V!_0SNL7j&9_RWB~v-s|6YW diff --git a/rest-app/smartpicasso/app/user_profile/migrations/__pycache__/0001_initial.cpython-38.pyc b/rest-app/smartpicasso/app/user_profile/migrations/__pycache__/0001_initial.cpython-38.pyc index e354c63832b91e1970d5603f142b2c1144e77107..94e7772ebae22bca859d004989044af2256d95ce 100644 GIT binary patch delta 20 acmbQwF`t7wl$V!_0SG4a9NWk(!U6y;cLa$5 delta 20 acmbQwF`t7wl$V!_0SNL7j&9@@VF3Uv;{;0p diff --git a/rest-app/smartpicasso/app/user_profile/migrations/__pycache__/__init__.cpython-38.pyc b/rest-app/smartpicasso/app/user_profile/migrations/__pycache__/__init__.cpython-38.pyc index 8f1df471de95c7aae8e37b5f4d0ad1686c189f50..48eab08fa8b1530035b9522ce27a0f16441013b1 100644 GIT binary patch delta 19 ZcmX@ic$kqpl$V!_0SG4a9Gl3!0{|{m1w#M; delta 19 ZcmX@ic$kqpl$V!_0SNL7j!xv>0RSxi1qA>A