From e4530f65db529d7eea9cb9174a44658f1eaaf72a Mon Sep 17 00:00:00 2001 From: Rezaul Karim Shaon Date: Fri, 6 Sep 2024 15:25:31 +0600 Subject: [PATCH 1/4] backend: github action updated backend linter name added --- .github/workflows/backend_lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend_lint.yml b/.github/workflows/backend_lint.yml index 1e19574..628960a 100644 --- a/.github/workflows/backend_lint.yml +++ b/.github/workflows/backend_lint.yml @@ -10,7 +10,7 @@ on: jobs: lint: - name: Flake8 Lint + name: Run Flake8 Lint runs-on: ubuntu-latest steps: From afeb274691f8744938f8b6bb1d4e18fed6ece4e8 Mon Sep 17 00:00:00 2001 From: Rezaul Karim Shaon Date: Fri, 6 Sep 2024 15:42:02 +0600 Subject: [PATCH 2/4] backend: user app installed, model for user --- backend/BookShelf/settings.py | 2 + backend/db.sqlite3 | Bin 131072 -> 135168 bytes backend/requirements.txt | 4 +- backend/user_api/__init__.py | 0 backend/user_api/admin.py | 3 ++ backend/user_api/apps.py | 6 +++ backend/user_api/migrations/0001_initial.py | 43 ++++++++++++++++ backend/user_api/migrations/__init__.py | 0 backend/user_api/models.py | 52 ++++++++++++++++++++ backend/user_api/tests.py | 3 ++ backend/user_api/views.py | 3 ++ 11 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 backend/user_api/__init__.py create mode 100644 backend/user_api/admin.py create mode 100644 backend/user_api/apps.py create mode 100644 backend/user_api/migrations/0001_initial.py create mode 100644 backend/user_api/migrations/__init__.py create mode 100644 backend/user_api/models.py create mode 100644 backend/user_api/tests.py create mode 100644 backend/user_api/views.py diff --git a/backend/BookShelf/settings.py b/backend/BookShelf/settings.py index 311898a..1ff94ac 100644 --- a/backend/BookShelf/settings.py +++ b/backend/BookShelf/settings.py @@ -37,6 +37,7 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'user_api', ] MIDDLEWARE = [ @@ -121,3 +122,4 @@ # https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' +AUTH_USER_MODEL = 'user_api.User' diff --git a/backend/db.sqlite3 b/backend/db.sqlite3 index f4563eda406ebccfd387385daf3263671b75584d..3c875bdd789a7cd67b7c229ec09d2ed34672745e 100644 GIT binary patch delta 3969 zcmb_fZERZS73P==_=C#@V*?4sU^}kkICd`ggAYepf^A}B19luccCv2dVy*!j0|AVi zOq+`pHPh6Oq<7NoG-*rvqtmKxs+TJH(Y31fr(3G2YNb})hpJ5d(Y0H)Y})ptU)y{6 zFyN%=pCQ?td(L^E^StMr_uQ99A8mZ}YU5?I?je~>)`k8mpMfg}X`~!lm{cGY5T8m0 z!*=>9;*bePqQ1o}BVH%IP56lh%`2L3X`J}K@Sorz+@O9-{gm3P*0#Lg^23&y7V~!D zPBTI46*5b&C(CEE@l-M^T(g?A?qP-;W|$$GBq=xLYZcz>JiMc%TyB@$?a>K6R(fy6 zlX5y4#!hM#GGniYi>$?y5|Cxb%(`8SgC>fh*0X#j#HHhPp(xtvCS4O6;gWf{8p`f) zl8$4z@RpgXDoH0zGoxxj-@)!E?QWKJI>uXs#SV8>>0+IX{dlu*t;1DSI%$`ao@x?4 z>NrwWI%t=R_B09(3td&Rc8A?Qq7u$qn5vR-QZDB)rSOWSO36;U?6hN4A^g`;Ly0Es z4)+8mjCEFbWT!})aUGHi&se*vn52`U*@*_>$i9mx&LFE#d`2B;MIBB#9NhTs{EYdM*}9^O?1Hv7RQqLO$3SS>ck=RH#^&P$Ct@ zF?m;G(KDJ!t*6^TehA7wYw>7?%SoM}M{%@Dd0$hdULi>^HppoZyJDbkS2h=!T#^xg zBiPyC$t0dZ-&kR|$bn57*m%cO5*8)h*>rN_$O3gPO}4&l~O$I~-5ljal6pESSL zY-@h3`JQH76V{y6cr=GJ*6qTF_$GmY6_oinzft61(qYg8$_Ss}b9{+aNwX9~`z&b; z8VoF;<4TxOXqf15G!+M8e&Z@me_N+66f!nj?)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zg_3vGje*P%G@tQ>I9G(Y4 z`06;cskCH^(%fkk*2bZ_x=0SWZK}BnyD;7bHo%3ayI{Ur{=CevQnm(YQRyfcHSLK|(R(N|H+J$eQ5b<>>F~Lq!(cIQ0aTuR? zjP!C)LjhVMJxMJGf>3F2SEpTYsr6t6uu=b3jVdQ1=Asj h%w) Date: Fri, 6 Sep 2024 15:46:40 +0600 Subject: [PATCH 3/4] backend: user - model, admin is_private field removed, admin updated --- backend/db.sqlite3 | Bin 135168 -> 135168 bytes backend/user_api/admin.py | 13 ++++++++++++- .../migrations/0002_remove_user_is_private.py | 17 +++++++++++++++++ backend/user_api/models.py | 1 - 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 backend/user_api/migrations/0002_remove_user_is_private.py diff --git a/backend/db.sqlite3 b/backend/db.sqlite3 index 3c875bdd789a7cd67b7c229ec09d2ed34672745e..e42db9ef9b9c3dc30917769da827d7c89ffe984a 100644 GIT binary patch delta 482 zcmZozz|pXPV}i7x1_J|wA`ruX&O{w!MvaXLOZb^ZxUNrT7f@&7y1ub-IhTu*2rGlE zvtwy-YEgV*L8gI$fl+)>YHog6YCKphvpBw>D6=fFB-O~k$VAt`QrEyt!NAhW#MH{r zNYBW~+}Of!v$S-B2qWj@Ir^rIBAYMin;5XDGw`c#Y~WNh7Uy(yoUEOnt&V26p_QRoVoGjio&%WFOU};)GbW$O*W@;}GBMY)Ffli?Fx^zZ zctM-_G=m_MFay5|-z7daUTf}GTz|RzIVW*su}@)p%NEI|!u*_h0&^%($;ye2lG|M! z7~7axfXC$p43d|IcQ@hWGsJKrS;gC+D^cj4T3djQqR=xU|pjKsY3)D$Hvg=(d=%+#EeVjweGDJVZDRVlW%HkJ)7Bp{wOGqf-;4NP|3=Pj*{D5 z9T?k~xmv89TDKe{^OvViML-P|7ThFDS|^ODsuMQb@|r&)F{J#`r38Gs}WM Z@{=C0EN8jED6pC31CzjZwhxTI Date: Fri, 6 Sep 2024 15:50:26 +0600 Subject: [PATCH 4/4] backend: user - admin add link clickable fields --- backend/user_api/admin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/user_api/admin.py b/backend/user_api/admin.py index 3e711a9..e44c6d4 100644 --- a/backend/user_api/admin.py +++ b/backend/user_api/admin.py @@ -9,6 +9,7 @@ class UserAdmin(admin.ModelAdmin): 'id', 'username', 'email', 'role', 'is_active', 'is_staff', 'is_superuser', ) + list_display_links = ('id', 'username', 'email') list_filter = ('role', 'is_active', 'is_staff') search_fields = ('username', 'email') readonly_fields = ('id',)