Skip to content

Commit

Permalink
Revert "To hackupc"
Browse files Browse the repository at this point in the history
  • Loading branch information
Casassarnau authored Mar 22, 2020
1 parent ac97afb commit 1be46f6
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 119 deletions.
7 changes: 3 additions & 4 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
"name": "HackAssistant Registration",
"description": "Hackathon registration server",
"env": {
"DOMAIN": {
"description": "Custom domain where app will be running (ignore if deploying using Heroku default domain)",
"value": "{SET THIS}.herokuapp.com",
"required": false
"DOMAIN": {
"description": "Domain where app will be running",
"value": ".herokuapp.com"
},
"SECRET": {
"description": "A secret key for verifying the integrity of signed cookies.",
Expand Down
9 changes: 1 addition & 8 deletions app/hackathon_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@
# This description will be used on the html and sharing meta tags
HACKATHON_DESCRIPTION = 'Join us for BarcelonaTech\'s hackathon. 700 hackers. 36h. October 11th-13th.'
# Domain where application is deployed, can be set by env variable
HACKATHON_DOMAIN = os.environ.get('DOMAIN', None)
HEROKU_APP_NAME = os.environ.get('HEROKU_APP_NAME', None)
if HEROKU_APP_NAME and not HACKATHON_DOMAIN:
HACKATHON_DOMAIN = '%s.herokuapp.com' % HEROKU_APP_NAME
elif not HACKATHON_DOMAIN:
HACKATHON_DOMAIN = 'localhost:8000'
HACKATHON_DOMAIN = os.environ.get('DOMAIN', 'localhost:8000')
# Hackathon contact email: where should all hackers contact you. It will also be used as a sender for all emails
HACKATHON_CONTACT_EMAIL = '[email protected]'
# Hackathon logo url, will be used on all emails
Expand Down Expand Up @@ -111,5 +106,3 @@

# Enable dubious separate pipeline (disabled by default)
DUBIOUS_ENABLED = True

SUPPORTED_RESUME_EXTENSIONS = []
4 changes: 2 additions & 2 deletions app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@
# Maximum file upload size for forms
MAX_UPLOAD_SIZE = 5242880

MAX_VOTES = 10

MAX_VOTES_TO_APP = 50
MAX_VOTES = 5

MEALS_TOKEN = os.environ.get('MEALS_TOKEN', None)

5 changes: 1 addition & 4 deletions applications/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,6 @@ def fieldsets(self):

class Meta:
model = models.Application
extensions = getattr(settings, 'SUPPORTED_RESUME_EXTENSIONS', None)

help_texts = {
'gender': 'This is for demographic purposes. You can skip this question if you want.',
'graduation_year': 'What year have you graduated on or when will you graduate',
Expand All @@ -251,8 +249,7 @@ class Meta:
'but at least we\'ll try!',
'projects': 'You can talk about about past hackathons, personal projects, awards etc. '
'(we love links) Show us your passion! :D',
'reimb_amount': 'We try our best to cover costs for all hackers, but our budget is limited',
'resume': 'Accepted file formats: %s' % (', '.join(extensions) if extensions else 'Any')
'reimb_amount': 'We try our best to cover costs for all hackers, but our budget is limited.'
}

widgets = {
Expand Down
26 changes: 0 additions & 26 deletions applications/migrations/0019_auto_20200321_1814.py

This file was deleted.

3 changes: 1 addition & 2 deletions applications/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

from app import utils
from user.models import User
from applications.validators import validate_file_extension

APP_PENDING = 'P'
APP_REJECTED = 'R'
Expand Down Expand Up @@ -142,7 +141,7 @@ class Application(models.Model):
lennyface = models.CharField(max_length=300, default='-.-')

# Giv me a resume here!
resume = models.FileField(upload_to='resumes', null=True, blank=True, validators=[validate_file_extension])
resume = models.FileField(upload_to='resumes', null=True, blank=True)
cvs_edition = models.BooleanField(default=False)

# University
Expand Down
10 changes: 0 additions & 10 deletions applications/validators.py

This file was deleted.

3 changes: 2 additions & 1 deletion organizers/templates/application_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ <h4>{{ comment.text }}</h4>
{% csrf_token %}
<input type="hidden" name="app_id" value="{{ app.pk }}"/>
<textarea name="comment_text" class="form-control" placeholder="Write a comment..."
rows="3" required maxlength="500"></textarea>
rows="3"
required></textarea>
<button name="add_comment" class="btn btn-block btn-default" value="comment">Add comment
</button>
</form>
Expand Down
4 changes: 1 addition & 3 deletions organizers/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,10 @@ def get_application(self, kwargs):
:return: pending aplication that has not been voted by the current
user and that has less votes and its older
"""
max_votes_to_app = getattr(settings, 'MAX_VOTES_TO_APP', 50)
return models.Application.objects \
.exclude(vote__user_id=self.request.user.id, user_id=self.request.user.id) \
.exclude(vote__user_id=self.request.user.id) \
.filter(status=APP_PENDING) \
.annotate(count=Count('vote__calculated_vote')) \
.filter(count__lte=max_votes_to_app) \
.order_by('count', 'submission_date') \
.first()

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ certifi==2019.9.11
chardet==3.0.4
defusedxml==0.6.0
dj-database-url==0.5.0
Django==1.11.28
Django==1.11.23
django-bootstrap3==8.2.3
django-filter==1.0.2
django-form-utils==1.0.3
Expand Down
48 changes: 0 additions & 48 deletions stats/templates/application_stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,6 @@ <h3>Gender</h3>
<div id="gender_stats"></div>
</div>
</div>
<h2>Origin</h2>

<div class="row">
<div class="col-md-6">
<h3>All</h3>
<div id="origin_stats"></div>
</div>
<div class="col-md-6">
<h3>Confirmed only</h3>
<div id="origin_stats_confirmed"></div>
</div>
</div>
<h2>T-Shirts sizes</h2>

<div class="row">
Expand Down Expand Up @@ -201,42 +189,6 @@ <h3>Confirmed only</h3>
}
}
});
c3.generate({
bindto: '#origin_stats',
data: {
json: data['origin'],
keys: {
x: 'origin',
value: ['applications']
},
type: 'bar'

},

axis: {
x: {
type: 'category'
}
}
});
c3.generate({
bindto: '#origin_stats_confirmed',
data: {
json: data['origin_confirmed'],
keys: {
x: 'origin',
value: ['applications']
},
type: 'bar'

},

axis: {
x: {
type: 'category'
}
}
});
$('#other_diet').html(data['other_diet']);
$('#update_date').html(data['update_time']);
$('#app_count').html(data['app_count']);
Expand Down
10 changes: 0 additions & 10 deletions stats/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ def app_stats_api(request):
gender_count = Application.objects.all().values('gender') \
.annotate(applications=Count('gender'))
gender_count = map(lambda x: dict(gender_name=GENDER_DICT[x['gender']], **x), gender_count)

origin_count = Application.objects.all().values('origin') \
.annotate(applications=Count('origin')) \
.order_by('applications')[:10]
origin_count_confirmed = Application.objects.filter(status=APP_CONFIRMED).values('origin') \
.annotate(applications=Count('origin')) \
.order_by('applications')[:10]

tshirt_dict = dict(a_models.TSHIRT_SIZES)
shirt_count = map(
lambda x: {'tshirt_size': tshirt_dict.get(x['tshirt_size'], 'Unknown'), 'applications': x['applications']},
Expand Down Expand Up @@ -95,8 +87,6 @@ def app_stats_api(request):
'shirt_count_confirmed': list(shirt_count_confirmed),
'timeseries': list(timeseries),
'gender': list(gender_count),
'origin': list(origin_count),
'origin_confirmed': list(origin_count_confirmed),
'diet': list(diet_count),
'diet_confirmed': list(diet_count_confirmed),
'other_diet': '<br>'.join([el['other_diet'] for el in other_diets if el['other_diet']])
Expand Down

0 comments on commit 1be46f6

Please sign in to comment.