Skip to content

Commit ceced76

Browse files
authored
👕 lint fix (#202)
1 parent cc46aaa commit ceced76

34 files changed

+80
-77
lines changed

LICENSE.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
Copyright (c) Revolution Systems, LLC and individual contributors.
22
All rights reserved.
3-
3+
44
Redistribution and use in source and binary forms, with or without modification,
55
are permitted provided that the following conditions are met:
6-
7-
1. Redistributions of source code must retain the above copyright notice,
6+
7+
1. Redistributions of source code must retain the above copyright notice,
88
this list of conditions and the following disclaimer.
9-
10-
2. Redistributions in binary form must reproduce the above copyright
9+
10+
2. Redistributions in binary form must reproduce the above copyright
1111
notice, this list of conditions and the following disclaimer in the
1212
documentation and/or other materials provided with the distribution.
13-
13+
1414
3. Neither the name of django-friendship nor the names of its contributors
1515
may be used to endorse or promote products derived from this software
1616
without specific prior written permission.
17-
17+
1818
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1919
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
2020
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -25,4 +25,3 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2525
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2626
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2727
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28-

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This application enables you to create and manage follows, blocks and bi-directi
1616

1717
Django 4.2, 5.1, and 5.2 + Python 3.9, 3.10, 3.11, 3.12, and 3.13 support added **>v1.9.6**
1818

19-
Previously:
19+
Previously:
2020

2121
- **Django 3.2 since v1.9.1**
2222
- **Django 1.11+** since v1.7.0 (latest release supporting **Django 1.10** is v1.6.0)
@@ -29,9 +29,8 @@ Previously:
2929

3030
```python
3131
urlpatterns = [
32-
...
33-
path('friendship/', include('friendship.urls'))
34-
...
32+
# other paths
33+
path("friendship/", include("friendship.urls"))
3534
]
3635
```
3736

@@ -87,17 +86,20 @@ from friendship.models import Friend, Follow, Block
8786
```python
8887
other_user = User.objects.get(pk=1)
8988
Friend.objects.add_friend(
90-
request.user, # The sender
91-
other_user, # The recipient
92-
message='Hi! I would like to add you') # This message is optional
89+
request.user, # The sender
90+
other_user, # The recipient
91+
message="Hi! I would like to add you",
92+
) # This message is optional
9393
```
9494

9595
#### Let the user who received the request respond:
9696

9797
```python
9898
from friendship.models import FriendshipRequest
9999

100-
friend_request = FriendshipRequest.objects.get(from_user=request.user, to_user=other_user)
100+
friend_request = FriendshipRequest.objects.get(
101+
from_user=request.user, to_user=other_user
102+
)
101103
friend_request.accept()
102104
# or friend_request.reject()
103105
```
@@ -167,9 +169,11 @@ Then use any of the following:
167169
`django-friendship` supports the following settings:
168170

169171
```python
170-
FRIENDSHIP_CONTEXT_OBJECT_NAME = 'user'
171-
FRIENDSHIP_CONTEXT_OBJECT_LIST_NAME = 'users'
172-
FRIENDSHIP_MANAGER_FRIENDSHIP_REQUEST_SELECT_RELATED_STRATEGY = 'select_related' # ('select_related', 'prefetch_related', 'none')
172+
FRIENDSHIP_CONTEXT_OBJECT_NAME = "user"
173+
FRIENDSHIP_CONTEXT_OBJECT_LIST_NAME = "users"
174+
FRIENDSHIP_MANAGER_FRIENDSHIP_REQUEST_SELECT_RELATED_STRATEGY = (
175+
"select_related" # ('select_related', 'prefetch_related', 'none')
176+
)
173177
```
174178

175179
### Contributing

docs/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
# All configuration values have a default; values that are commented out
1111
# serve to show the default.
1212

13-
import os
14-
import sys
1513

1614
# If extensions (or modules to document with autodoc) are in another directory,
1715
# add these directories to sys.path here. If the directory is relative to the

docs/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ Indices and tables
2020
* :ref:`genindex`
2121
* :ref:`modindex`
2222
* :ref:`search`
23-

example/sample/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
# Examples:
77
# url(r'^$', 'sample.views.home', name='home'),
88
# url(r'^blog/', include('blog.urls')),
9-
path('friendship/', include("friendship.urls")),
10-
path('admin/', admin.site.urls),
9+
path("friendship/", include("friendship.urls")),
10+
path("admin/", admin.site.urls),
1111
]

friendship/migrations/0001_initial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
class Migration(migrations.Migration):
8-
98
dependencies = [
109
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
1110
]

friendship/migrations/0002_block.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
class Migration(migrations.Migration):
8-
98
dependencies = [
109
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
1110
("friendship", "0001_initial"),

friendship/migrations/0003_block_unique_together.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
class Migration(migrations.Migration):
10-
1110
dependencies = [
1211
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
1312
("friendship", "0002_block"),

friendship/migrations/0004_auto_20200408_1844.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
class Migration(migrations.Migration):
7-
87
dependencies = [
98
("friendship", "0003_block_unique_together"),
109
]

friendship/migrations/0005_auto_20211005_1716.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,37 @@
44

55

66
class Migration(migrations.Migration):
7-
87
dependencies = [
9-
('friendship', '0004_auto_20200408_1844'),
8+
("friendship", "0004_auto_20200408_1844"),
109
]
1110

1211
operations = [
1312
migrations.AlterField(
14-
model_name='block',
15-
name='id',
16-
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
13+
model_name="block",
14+
name="id",
15+
field=models.BigAutoField(
16+
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
17+
),
1718
),
1819
migrations.AlterField(
19-
model_name='follow',
20-
name='id',
21-
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
20+
model_name="follow",
21+
name="id",
22+
field=models.BigAutoField(
23+
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
24+
),
2225
),
2326
migrations.AlterField(
24-
model_name='friend',
25-
name='id',
26-
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
27+
model_name="friend",
28+
name="id",
29+
field=models.BigAutoField(
30+
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
31+
),
2732
),
2833
migrations.AlterField(
29-
model_name='friendshiprequest',
30-
name='id',
31-
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
34+
model_name="friendshiprequest",
35+
name="id",
36+
field=models.BigAutoField(
37+
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
38+
),
3239
),
3340
]

0 commit comments

Comments
 (0)