-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ft(escalating): add feature to report article
- add model for reported articles - add serializer for reported articles - add view to report articles - add url to report articles - perform flake8 corrections [DELIVERS #160617687] ft(escalating): correct migrations -correct migrations [FIXES #160617687] ft(escalating): escalations - add admin access [DELIVERS #160617687] ft(escalating): escalations - add times article - add report article serializer - add report article urls - add report view - add migrations - add tests for the feature [DELIVERS #160617687]
- Loading branch information
Showing
19 changed files
with
448 additions
and
153 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
from django.contrib import admin | ||
from authors.apps.articles.models import Article, RateArticle, LikeArticle, Category | ||
|
||
from authors.apps.articles.models import (Article, Category, LikeArticle, | ||
RateArticle, Reported) | ||
|
||
admin.site.register(Article) | ||
admin.site.register(RateArticle) | ||
admin.site.register(LikeArticle) | ||
admin.site.register(Category) | ||
admin.site.register(Reported) |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 2.1.1 on 2018-10-17 16:57 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('articles', '0005_merge_20181016_2114'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Reported', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('reason', models.TextField()), | ||
('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='articles.Article', to_field='slug')), | ||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, to_field='email')), | ||
], | ||
), | ||
] |
20 changes: 20 additions & 0 deletions
20
authors/apps/articles/migrations/0007_reported_created_at.py
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated by Django 2.1.1 on 2018-10-18 07:30 | ||
|
||
from django.db import migrations, models | ||
import django.utils.timezone | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('articles', '0006_reported'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='reported', | ||
name='created_at', | ||
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now), | ||
preserve_default=False, | ||
), | ||
] |
17 changes: 17 additions & 0 deletions
17
authors/apps/articles/migrations/0008_auto_20181018_1517.py
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 2.1.1 on 2018-10-18 12:17 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('articles', '0007_reported_created_at'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='reported', | ||
options={'ordering': ['-created_at']}, | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
authors/apps/articles/migrations/0009_reported_times_reported.py
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.1.1 on 2018-10-18 13:21 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('articles', '0008_auto_20181018_1517'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='reported', | ||
name='times_reported', | ||
field=models.IntegerField(default=0), | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
authors/apps/articles/migrations/0010_article_times_reported.py
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.1.1 on 2018-10-18 13:43 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('articles', '0009_reported_times_reported'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='article', | ||
name='times_reported', | ||
field=models.IntegerField(default=0), | ||
), | ||
] |
17 changes: 17 additions & 0 deletions
17
authors/apps/articles/migrations/0011_remove_reported_times_reported.py
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 2.1.1 on 2018-10-18 13:53 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('articles', '0010_article_times_reported'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='reported', | ||
name='times_reported', | ||
), | ||
] |
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
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
Oops, something went wrong.