-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a basic ui for review , review list , create review pages Edit model.py ( use a many-to-many relationship instead of json field ) Add test Signed-off-by: ziad <[email protected]>
- Loading branch information
Showing
19 changed files
with
1,235 additions
and
306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
from django import forms | ||
from django.contrib.auth.forms import UserCreationForm | ||
from django.contrib.auth.models import User | ||
|
||
|
||
class CreateRepoForm(forms.Form): | ||
repo_name = forms.CharField() | ||
repo_url = forms.URLField(required=True) | ||
|
||
|
||
class SecurityTeamSignUpForm(UserCreationForm): | ||
email = forms.EmailField(max_length=254) | ||
|
||
class Meta: | ||
model = User | ||
fields = ( | ||
"username", | ||
"email", | ||
"password1", | ||
"password2", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
# Generated by Django 4.2.2 on 2023-06-29 08:43 | ||
# Generated by Django 4.2.2 on 2023-07-03 13:56 | ||
|
||
import uuid | ||
|
||
import django.db.models.deletion | ||
from django.conf import settings | ||
from django.db import migrations | ||
from django.db import models | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
@@ -37,18 +35,8 @@ class Migration(migrations.Migration): | |
("note", models.CharField(help_text="the profile description", max_length=100)), | ||
("public_key", models.TextField()), | ||
( | ||
"followers", | ||
models.JSONField( | ||
default=dict, | ||
help_text="e.g. {'secrityteam@vcio': ['pkg:npm/[email protected]']}", | ||
), | ||
), | ||
("followers_count", models.PositiveIntegerField(default=0)), | ||
( | ||
"user", | ||
models.OneToOneField( | ||
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL | ||
), | ||
"database_type", | ||
models.IntegerField(choices=[(0, "Local"), (1, "Remote")], default=1), | ||
), | ||
], | ||
options={ | ||
|
@@ -112,8 +100,13 @@ class Migration(migrations.Migration): | |
auto_created=True, primary_key=True, serialize=False, verbose_name="ID" | ||
), | ||
), | ||
("voter_acct", models.CharField(help_text="[email protected]", max_length=100)), | ||
("gainer_acct", models.CharField(help_text="[email protected]", max_length=100)), | ||
("voter", models.CharField(help_text="[email protected]", max_length=100)), | ||
("acceptor", models.CharField(help_text="[email protected]", max_length=100)), | ||
("object_url", models.URLField()), | ||
( | ||
"object_type", | ||
models.IntegerField(choices=[(0, "Review"), (1, "Comment")], default=0), | ||
), | ||
("positive", models.BooleanField(default=True)), | ||
], | ||
), | ||
|
@@ -157,16 +150,24 @@ class Migration(migrations.Migration): | |
("note", models.CharField(help_text="the profile description", max_length=100)), | ||
("public_key", models.TextField()), | ||
( | ||
"following", | ||
models.JSONField( | ||
default=dict, help_text="e.g. {'datebase1@vcio': ['pkg:npm/[email protected]']}" | ||
"security_team_type", | ||
models.IntegerField(choices=[(0, "Local"), (1, "Remote")], default=1), | ||
), | ||
( | ||
"remote_actor", | ||
models.OneToOneField( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="review.remotesecurityteam", | ||
), | ||
), | ||
("following_count", models.PositiveIntegerField(default=0)), | ||
( | ||
"user", | ||
models.OneToOneField( | ||
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
], | ||
|
@@ -188,7 +189,7 @@ class Migration(migrations.Migration): | |
( | ||
"status", | ||
models.IntegerField( | ||
choices=[(1, "Open"), (2, "Draft"), (3, "Closed"), (4, "Merged")] | ||
choices=[(0, "Open"), (1, "Draft"), (2, "Closed"), (3, "Merged")] | ||
), | ||
), | ||
( | ||
|
@@ -219,4 +220,53 @@ class Migration(migrations.Migration): | |
), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name="databaseadmin", | ||
name="remote_actor", | ||
field=models.OneToOneField( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="review.remotedatabaseadmin", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="databaseadmin", | ||
name="user", | ||
field=models.OneToOneField( | ||
null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL | ||
), | ||
), | ||
migrations.CreateModel( | ||
name="Follow", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, primary_key=True, serialize=False, verbose_name="ID" | ||
), | ||
), | ||
( | ||
"database_admin", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to="review.databaseadmin" | ||
), | ||
), | ||
( | ||
"purl", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to="review.packageurl" | ||
), | ||
), | ||
( | ||
"security_team", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to="review.securityteam" | ||
), | ||
), | ||
], | ||
options={ | ||
"unique_together": {("purl", "database_admin", "security_team")}, | ||
}, | ||
), | ||
] |
Oops, something went wrong.