Show More
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
@@ -590,3 +590,6 b' msgstr "\xd0\x9d\xd0\xb5\xd0\xba\xd0\xbe\xd1\x82\xd0\xbe\xd1\x80\xd1\x8b\xd0\xb5 \xd1\x84\xd0\xb0\xd0\xb9\xd0\xbb\xd1\x8b \xd1\x83\xd0\xb6\xd0\xb5 \xd0\xbf\xd1\x80\xd0\xb8\xd1\x81\xd1\x83\xd1\x82\xd1\x81\xd1\x82\xd0\xb2\xd1\x83\xd1\x8e\xd1\x82 \xd0\xbd\xd0\xb0 \xd0\xb1\xd0\xbe\xd1\x80\xd0\xb4\xd0\xb5."' | |||||
590 | msgid "Do not download URLs" |
|
590 | msgid "Do not download URLs" | |
591 | msgstr "Не загружать ссылки" |
|
591 | msgstr "Не загружать ссылки" | |
592 |
|
592 | |||
|
593 | msgid "Ban and delete" | |||
|
594 | msgstr "Забанить и удалить" | |||
|
595 |
@@ -7,6 +7,7 b' from boards.abstracts.exceptions import ' | |||||
7 | from django.db import models, transaction |
|
7 | from django.db import models, transaction | |
8 | from django.utils import timezone |
|
8 | from django.utils import timezone | |
9 | from django.dispatch import Signal |
|
9 | from django.dispatch import Signal | |
|
10 | from django.core.exceptions import PermissionDenied | |||
10 |
|
11 | |||
11 | import boards |
|
12 | import boards | |
12 |
|
13 | |||
@@ -43,7 +44,7 b' class PostManager(models.Manager):' | |||||
43 | is_banned = False |
|
44 | is_banned = False | |
44 |
|
45 | |||
45 | if is_banned: |
|
46 | if is_banned: | |
46 | raise BannedException("This user is banned") |
|
47 | raise PermissionDenied() | |
47 |
|
48 | |||
48 | if not tags: |
|
49 | if not tags: | |
49 | tags = [] |
|
50 | tags = [] |
@@ -100,7 +100,7 b'' | |||||
100 | visible: {% if post.global_id_id %}true{% else %}false{% endif %} |
|
100 | visible: {% if post.global_id_id %}true{% else %}false{% endif %} | |
101 | }, |
|
101 | }, | |
102 | banAndDelete: { |
|
102 | banAndDelete: { | |
103 | name: 'Ban and delete', |
|
103 | name: '{% trans "Ban and delete" %}', | |
104 | callback: function(key, opt) { |
|
104 | callback: function(key, opt) { | |
105 | window.location = '{% url 'utils' %}?method=ban_and_delete&post_id={{ post.id }}'; |
|
105 | window.location = '{% url 'utils' %}?method=ban_and_delete&post_id={{ post.id }}'; | |
106 | }, |
|
106 | }, |
@@ -1,6 +1,8 b'' | |||||
1 | from django.shortcuts import redirect |
|
1 | from django.shortcuts import redirect | |
2 | from django.utils.decorators import method_decorator |
|
2 | from django.utils.decorators import method_decorator | |
3 | from django.views.decorators.csrf import csrf_protect |
|
3 | from django.views.decorators.csrf import csrf_protect | |
|
4 | from django.contrib.auth.decorators import permission_required | |||
|
5 | ||||
4 | from boards.views.base import BaseBoardView, CONTEXT_FORM |
|
6 | from boards.views.base import BaseBoardView, CONTEXT_FORM | |
5 | from boards.views.mixins import DispatcherMixin, PARAMETER_METHOD |
|
7 | from boards.views.mixins import DispatcherMixin, PARAMETER_METHOD | |
6 | from boards.models import Post, Ban |
|
8 | from boards.models import Post, Ban | |
@@ -13,7 +15,7 b' class UtilsView(BaseBoardView, Dispatche' | |||||
13 |
|
15 | |||
14 | return redirect('index') |
|
16 | return redirect('index') | |
15 |
|
17 | |||
16 |
|
18 | @permission_required('boards.delete_post') | ||
17 | def ban_and_delete(self, request): |
|
19 | def ban_and_delete(self, request): | |
18 | post = Post.objects.get(id=request.GET['post_id']) |
|
20 | post = Post.objects.get(id=request.GET['post_id']) | |
19 | Ban.objects.get_or_create(ip=post.poster_ip) |
|
21 | Ban.objects.get_or_create(ip=post.poster_ip) |
General Comments 0
You need to be logged in to leave comments.
Login now