micro-users 1.3.0__py3-none-any.whl → 1.3.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of micro-users might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: micro-users
3
- Version: 1.3.0
3
+ Version: 1.3.1
4
4
  Summary: Arabic Django user management app with abstract user, permissions, and activity logging
5
5
  Home-page: https://github.com/debeski/micro-users
6
6
  Author: DeBeski
@@ -130,3 +130,4 @@ users/
130
130
  | v1.2.3 | • Separated user detail view from table for consistency<br> • Optimized the new detail + log view for optimal compatibiliyy with users |
131
131
  | v1.2.4 | • Fixed a couple of visual inconsistencies |
132
132
  | v1.3.0 | • Patched a critical security permission issue<br> • Disabled ADMIN from being viewed/edited from other staff members<br> • Fixed an issue when sorting with full_name<br> • Enabled Logging for all actions |
133
+ | v1.3.1 | • replaced a misplaced code that caused a crash when editing profile |
@@ -7,7 +7,7 @@ users/models.py,sha256=V_SIyGGq2w_bww7YufMjqXMSKN1u9CkSMPuOLiwPjtc,2100
7
7
  users/signals.py,sha256=5Kd3KyfPT6740rvwZj4vy1yXsmjVhmaQ__RB8p5R5aE,1336
8
8
  users/tables.py,sha256=WwC7BMpzNrcfEatJj6gHMP8k_FGqer-Zfn9vZRB7kZo,2196
9
9
  users/urls.py,sha256=FwQ9GVOBRQ4iXQ9UyLFI0aEAga0d5qL_miPNpmFPA-Q,1022
10
- users/views.py,sha256=_O6xRoej-JW4u-9vTK55Jr4SVRpgL2qG1BSx1o6xYRs,8741
10
+ users/views.py,sha256=oJLsr_G7TJP3Y6lRdkoP2oNVGe8tYD3x8I4ARO_iDA8,8730
11
11
  users/migrations/0001_initial.py,sha256=lx9sSKS-lxHhI6gelVH52NOkwqEMJ32TvOJUn9zaOXM,4709
12
12
  users/migrations/0002_alter_useractivitylog_action.py,sha256=I7NLxgcPTslCMuADcr1srXS_C_0y_LcZiAFFHBG5NsE,715
13
13
  users/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -21,8 +21,8 @@ users/templates/users/profile_edit.html,sha256=L9DUHlQHG-PmxwxBbSjgPk1dEmy0spPi6
21
21
  users/templates/users/user_actions.html,sha256=J44-sn0fMbLUWjdtlcf5YhgT5OYRykr1mFkeVXoI1ew,1543
22
22
  users/templates/users/user_detail.html,sha256=QkJ-6jdtUdi8mM-V_MzqYcdoEkzXEsIeFMliNjgIOsc,2053
23
23
  users/templates/users/user_form.html,sha256=jcyI7OQZOY4ue4DajPtfjAt2SmAYO5ZgHNOqTp2-FO0,1352
24
- micro_users-1.3.0.dist-info/LICENSE,sha256=Fco89ULLSSxKkC2KKnx57SaT0R7WOkZfuk8IYcGiN50,1063
25
- micro_users-1.3.0.dist-info/METADATA,sha256=tI_SdrsRx0JA1ppDV95GZUzYeOVvoUYzt7cPvEDUelQ,4277
26
- micro_users-1.3.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
27
- micro_users-1.3.0.dist-info/top_level.txt,sha256=tWT24ZcWau2wrlbpU_h3mP2jRukyLaVYiyHBuOezpLQ,6
28
- micro_users-1.3.0.dist-info/RECORD,,
24
+ micro_users-1.3.1.dist-info/LICENSE,sha256=Fco89ULLSSxKkC2KKnx57SaT0R7WOkZfuk8IYcGiN50,1063
25
+ micro_users-1.3.1.dist-info/METADATA,sha256=IdsBDJU5IATuaw3bbwJyapchgPYJo2itC_-SnIZfubA,4363
26
+ micro_users-1.3.1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
27
+ micro_users-1.3.1.dist-info/top_level.txt,sha256=tWT24ZcWau2wrlbpU_h3mP2jRukyLaVYiyHBuOezpLQ,6
28
+ micro_users-1.3.1.dist-info/RECORD,,
users/views.py CHANGED
@@ -100,6 +100,12 @@ def create_user(request):
100
100
  @user_passes_test(is_staff)
101
101
  def edit_user(request, pk):
102
102
  user = get_object_or_404(User, pk=pk)
103
+
104
+ # 🚫 Block staff users from editing superuser accounts
105
+ if user.is_superuser and not request.user.is_superuser:
106
+ messages.error(request, "لا يمكن تعديل هذا الحساب!")
107
+ return redirect('manage_users')
108
+
103
109
  form_reset = ResetPasswordForm(user, data=request.POST or None)
104
110
 
105
111
  if request.method == "POST":
@@ -216,12 +222,6 @@ def user_profile(request):
216
222
  # Function for editing the user profile
217
223
  @login_required
218
224
  def edit_profile(request):
219
-
220
- # 🚫 Block staff users from editing superuser accounts
221
- if request.user.is_superuser and not request.user.is_superuser:
222
- messages.error(request, "لا يمكنك تعديل حساب المدير!")
223
- return redirect('user_profile')
224
-
225
225
  if request.method == 'POST':
226
226
  form = UserProfileEditForm(request.POST, request.FILES, instance=request.user)
227
227
  if form.is_valid():
@@ -231,9 +231,6 @@ def edit_profile(request):
231
231
  return redirect('user_profile')
232
232
  else:
233
233
  messages.error(request, 'حدث خطأ أثناء حفظ التغييرات')
234
-
235
234
  else:
236
235
  form = UserProfileEditForm(instance=request.user)
237
-
238
236
  return render(request, 'users/profile_edit.html', {'form': form})
239
-