Skip to content

Commit 302ead1

Browse files
committed
.
Signed-off-by: ziadhany <ziadhany2016@gmail.com>
1 parent e2cf21d commit 302ead1

14 files changed

Lines changed: 62 additions & 97 deletions

purl_sync/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ black:
6060
@echo "-> Apply black code formatter"
6161
${VENV}/bin/black .
6262

63-
doc8:
64-
@echo "-> Run doc8 validation"
65-
@${ACTIVATE} doc8 --max-line-length 100 --ignore-path docs/_build/ --quiet docs/
66-
6763
valid: isort black
6864

6965
check:

purl_sync/private.pem

Lines changed: 0 additions & 28 deletions
This file was deleted.

purl_sync/public.pem

Lines changed: 0 additions & 9 deletions
This file was deleted.

purl_sync/purl_sync/settings.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@
77
ROOT_DIR = PROJECT_DIR.parent
88
# Environment
99

10-
ENV_FILE = "/etc/purl_sync/.env"
10+
ENV_FILE = "purl_sync/.env"
1111
if not Path(ENV_FILE).exists():
1212
ENV_FILE = ROOT_DIR / ".env"
1313

1414
env = environ.Env()
1515
environ.Env.read_env(str(ENV_FILE))
1616

1717
DOMAIN = env.str("DOMAIN", "127.0.0.1")
18-
PUBLIC_KEY = env.str("PUBLIC_KEY")
1918

2019
# Build paths inside the project like this: BASE_DIR / 'subdir'.
2120
BASE_DIR = Path(__file__).resolve().parent.parent

purl_sync/review/activitypub.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ def save(self):
310310
}
311311

312312
if (
313-
(isinstance(actor, Person) and self.object.type in ["Note", "Review"])
314-
or (isinstance(actor, Service) and self.object.type == "Repository")
315-
or (isinstance(actor, Purl) and self.object.type == "Note")
313+
(isinstance(actor, Person) and self.object.type in ["Note", "Review"])
314+
or (isinstance(actor, Service) and self.object.type == "Repository")
315+
or (isinstance(actor, Purl) and self.object.type == "Note")
316316
):
317317
for key, value in updated_param[self.object.type].items():
318318
if value:
@@ -346,9 +346,9 @@ def save(self):
346346
return self.failed_ap_rs()
347347

348348
if (
349-
(type(actor) is Person and self.object.type in ["Note", "Review"])
350-
or (type(actor) is Purl and self.object.type in ["Note"])
351-
or (type(actor) is Service and self.object.type == ["Repository", "Purl"])
349+
(type(actor) is Person and self.object.type in ["Note", "Review"])
350+
or (type(actor) is Purl and self.object.type in ["Note"])
351+
or (type(actor) is Service and self.object.type == ["Repository", "Purl"])
352352
):
353353
instance = self.object.get_object()
354354
instance.delete()

purl_sync/review/forms.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ class CreateReviewForm(forms.Form):
7777

7878

7979
class SubscribePurlForm(forms.Form):
80-
acct = forms.CharField(label="Subscribe with a remote account:",
81-
widget=forms.TextInput(
82-
attrs={'placeholder': 'ziadhany@vulnerablecode.io',
83-
'class': 'input'
84-
}))
80+
acct = forms.CharField(
81+
label="Subscribe with a remote account:",
82+
widget=forms.TextInput(
83+
attrs={"placeholder": "ziadhany@vulnerablecode.io", "class": "input"}
84+
),
85+
)

purl_sync/review/migrations/0001_initial.py

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

1010

1111
class Migration(migrations.Migration):
12-
1312
initial = True
1413

1514
dependencies = [

purl_sync/review/migrations/0002_alter_person_avatar_alter_purl_avatar.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
("review", "0001_initial"),
1110
]

purl_sync/review/migrations/0003_remove_note_note_type.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
("review", "0002_alter_person_avatar_alter_purl_avatar"),
109
]

purl_sync/review/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ def outbox_url(self):
206206
def followers_url(self):
207207
return full_reverse("purl-followers", self.string)
208208

209+
@property
210+
def key_id(self):
211+
return full_reverse("purl-ap-profile", self.string)
212+
209213
@property
210214
def to_ap(self):
211215
return {

0 commit comments

Comments
 (0)