Skip to content

Commit

Permalink
add manual label (#9516)
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc authored Sep 24, 2021
1 parent a243dba commit bed2a26
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/grants/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ def toggle_user_sybil(sybil_users, non_sybil_users):
print(f"error: unable to mark user ${user.get('handle')} as sybil. {e}")

if non_sybil_users:
# exclude squelches added by manual
squelched_profiles = squelched_profiles.exclude(label='Manual')
# iterate and remove sybil from user
for user in non_sybil_users:
try:
Expand Down
2 changes: 1 addition & 1 deletion app/quests/quest_types/quiz_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def details(request, quest):
answer_level_seconds_to_respond = payload.get('seconds_to_respond', None)
if answer_level_seconds_to_respond:
this_time_per_answer = answer_level_seconds_to_respond
time_used = (timezone.now() - qa.modified_on).seconds
time_used = (timezone.now() - qa.modified_on).seconds if qa else timezone.now()
is_out_of_time = time_used > this_time_per_answer + time_per_answer_buffer
if is_out_of_time:
# fix for silly issue where the time used is almost exactly
Expand Down
18 changes: 18 additions & 0 deletions app/townsquare/migrations/0026_auto_20210923_1428.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.24 on 2021-09-23 14:28

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('townsquare', '0025_squelchprofile_label'),
]

operations = [
migrations.AlterField(
model_name='squelchprofile',
name='label',
field=models.CharField(choices=[('Human', 'Human'), ('Heuristic', 'Heuristic'), ('Prediction', 'Prediction'), ('Manual', 'Manual')], default='Manual', help_text='means used to mark user as sybil', max_length=20),
),
]
5 changes: 3 additions & 2 deletions app/townsquare/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@ class SquelchProfile(SuperModel):
LABEL_CHOICES = (
('Human', 'Human'),
('Heuristic', 'Heuristic'),
('Prediction', 'Prediction')
('Prediction', 'Prediction'),
('Manual', 'Manual')
)
profile = models.ForeignKey(
'dashboard.Profile',
Expand All @@ -451,7 +452,7 @@ class SquelchProfile(SuperModel):
)
label = models.CharField(
choices=LABEL_CHOICES,
default='Human',
default='Manual',
help_text='means used to mark user as sybil',
max_length=20
)
Expand Down

0 comments on commit bed2a26

Please sign in to comment.