Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/static/css/custom-bootstrap.css
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}
.btn-group-lg>.btn,.btn-lg{line-height:1.3333333;border-radius:8px}
.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:8px}
.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:8px}
.btn-block{display:block;width:100%}
.btn-block{display:block;width:100%;margin-top:5px}
.btn-block+.btn-block{margin-top:5px}
input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}
.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}
Expand Down
1 change: 1 addition & 0 deletions applications/forms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def get_exclude_fields():
"status_update_date",
"status",
"contacted_by",
"dubious_type",
"blacklisted_by",
]

Expand Down
31 changes: 31 additions & 0 deletions applications/migrations/0063_auto_20251228_1841.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Generated by Django 3.2.23 on 2025-12-28 18:41

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),
('applications', '0062_auto_20251228_1817'),
]

operations = [
migrations.AddField(
model_name='hackerapplication',
name='dubious_comment',
field=models.TextField(blank=True, max_length=500, null=True),
),
migrations.AddField(
model_name='hackerapplication',
name='dubious_type',
field=models.CharField(choices=[('OK', 'Not dubious'), ('INVALID_CV', 'Invalid CV'), ('LATE_GRAD', 'Invalid graduation year'), ('NOT_STUDENT', 'Not a student'), ('INVALID_SCHOOL', 'Invalid school'), ('OTHER', 'Other')], default='OK', max_length=300),
),
migrations.AddField(
model_name='hackerapplication',
name='dubioused_by',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='dubioused_by', to=settings.AUTH_USER_MODEL),
),
]
16 changes: 16 additions & 0 deletions applications/models/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,19 @@
DEFAULT_YEAR = datetime.now().year + 1

ENGLISH_LEVEL = [(i, str(i)) for i in range(1, 5 + 1)]

DUBIOUS_NONE = 'OK'
DUBIOUS_CV = 'INVALID_CV'
DUBIOUS_GRADUATION_YEAR = 'LATE_GRAD'
DUBIOUS_NOT_STUDENT = 'NOT_STUDENT'
DUBIOUS_SCHOOL = 'INVALID_SCHOOL'
DUBIOUS_OTHER = 'OTHER'

DUBIOUS_TYPES = [
(DUBIOUS_NONE, 'Not dubious'),
(DUBIOUS_CV, 'Invalid CV'),
(DUBIOUS_GRADUATION_YEAR, 'Invalid graduation year'),
(DUBIOUS_NOT_STUDENT, 'Not a student'),
(DUBIOUS_SCHOOL, 'Invalid school'),
(DUBIOUS_OTHER, 'Other')
]
25 changes: 14 additions & 11 deletions applications/models/hacker.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,13 @@ class HackerApplication(BaseApplication):
projects = models.TextField(max_length=500, blank=True, null=True)

# META
contacted = models.BooleanField(
default=False
) # If a dubious application has been contacted yet
contacted_by = models.ForeignKey(
User,
related_name="contacted_by",
blank=True,
null=True,
on_delete=models.SET_NULL,
)
dubious_type = models.CharField(max_length=300, choices=DUBIOUS_TYPES, default=DUBIOUS_NONE) # Type of dubious application
dubioused_by = models.ForeignKey(User, related_name='dubioused_by', blank=True, null=True,
on_delete=models.SET_NULL) # User who marked this application as dubious
dubious_comment = models.TextField(max_length=500, blank=True, null=True) # Comment for dubious application
contacted = models.BooleanField(default=False) # If a dubious application has been contacted yet
contacted_by = models.ForeignKey(User, related_name='contacted_by', blank=True, null=True,
on_delete=models.SET_NULL)

reviewed = models.BooleanField(
default=False
Expand Down Expand Up @@ -101,10 +98,13 @@ def invalidate(self):
team.delete()
self.save()

def set_dubious(self):
def set_dubious(self, user, dubious_type, dubious_comment_text):
self.status = APP_DUBIOUS
self.contacted = False
self.status_update_date = timezone.now()
self.dubioused_by = user
self.dubious_type = dubious_type
self.dubious_comment = dubious_comment_text
self.vote_set.all().delete()
if hasattr(self, "acceptedresume"):
self.acceptedresume.delete()
Expand All @@ -113,6 +113,9 @@ def set_dubious(self):
def unset_dubious(self):
self.status = APP_PENDING
self.status_update_date = timezone.now()
self.dubioused_by = None
self.dubious_type = DUBIOUS_NONE
self.dubious_comment = None
self.save()

def set_flagged_cv(self):
Expand Down
14 changes: 7 additions & 7 deletions applications/templates/application.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
{% endif %}
<div style="padding-left: 15px; padding-right: 15px">
<div class="alert alert-warning">
{% if application.can_be_edit %}
<p>
Be careful, you can only edit the application until 2 hours after <b style="text-decoration: underline;">{{application.submission_date}}</b></p>
{% if application.can_be_edit %}


<p>
Be careful, you can only edit the application until 2 hours after <b style="text-decoration: underline;">{{application.submission_date}}</b></p>

{% else %}
<p>Your application has been reviewed already. Editing has been disabled to make sure all reviewers get the
<p>Your application has been reviewed already. Editing has been disabled to make sure all reviewers get the
same data. If you would like to change something important, please email us at {{ h_contact_email|urlize }}.</p>
{% endif %}
{% endif %}
</div>
</div>
{% include 'include/application_form.html' %}
Expand Down
Loading