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

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion FusionIIIT/applications/globals/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class ExtraInfo(models.Model):
phone_no = models.BigIntegerField(null=True, default=9999999999)
user_type = models.CharField(max_length=20, choices=Constants.USER_CHOICES)
department = models.ForeignKey(
DepartmentInfo, on_delete=models.CASCADE, null=False, blank=True)
DepartmentInfo, on_delete=models.CASCADE, null=True, blank=True)
profile_picture = models.ImageField(
null=True, blank=True, upload_to='globals/profile_pictures')
about_me = models.TextField(default='NA', max_length=1000, blank=True)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 3.1.5 on 2024-02-16 18:24

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
('gymkhana', '0002_auto_20240214_1808'),
]

operations = [
migrations.AlterField(
model_name='club_info',
name='created_on',
field=models.DateField(default=django.utils.timezone.now),
),
migrations.AlterField(
model_name='club_info',
name='head_changed_on',
field=models.DateField(default=django.utils.timezone.now),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.1.5 on 2024-02-16 19:07

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('gymkhana', '0003_auto_20240216_1824'),
]

operations = [
migrations.AlterField(
model_name='club_info',
name='created_on',
field=models.DateField(default=None, null=True),
),
migrations.AlterField(
model_name='club_info',
name='head_changed_on',
field=models.DateField(default=None, null=True),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 3.1.5 on 2024-02-16 19:29

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
('gymkhana', '0004_auto_20240216_1907'),
]

operations = [
migrations.AlterField(
model_name='club_info',
name='created_on',
field=models.DateField(default=django.utils.timezone.now, null=True),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 3.1.5 on 2024-02-17 15:30

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
('gymkhana', '0005_auto_20240216_1929'),
]

operations = [
migrations.AlterField(
model_name='club_info',
name='head_changed_on',
field=models.DateField(default=django.utils.timezone.now, null=True),
),
]
8 changes: 5 additions & 3 deletions FusionIIIT/applications/gymkhana/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Club_info(models.Model):
spent_budget - the amount spent by the club
avail_budget - the amount available at the club
status - status of club wheather it is confirmed or not

"""

club_name = models.CharField(max_length=50, null=False, primary_key=True)
Expand All @@ -93,8 +93,8 @@ class Club_info(models.Model):
spent_budget = models.IntegerField(null=True, default=0)
avail_budget = models.IntegerField(null=True, default=0)
status = models.CharField(max_length=50, choices=Constants.status, default="open")
head_changed_on = models.DateField(default=None, auto_now=False, null=False)
created_on = models.DateField(default=None, auto_now=False, null=False)
head_changed_on = models.DateField(default=timezone.now, auto_now=False, null=True)
created_on = models.DateField(default=timezone.now, auto_now=False, null=True)

def __str__(self):
return str(self.club_name)
Expand Down Expand Up @@ -222,6 +222,7 @@ class Club_budget(models.Model):
budget_file - it is file which contains complete details regarding the amount they want to spend
descrion - description about the budget if any
"""

id = models.AutoField(primary_key=True)
club = models.ForeignKey(
Club_info, on_delete=models.CASCADE, max_length=50, null=False
Expand Down Expand Up @@ -254,6 +255,7 @@ class Session_info(models.Model):
details - for which purpose they are taking the session
status - wheather it is approved/rejected.
"""

id = models.AutoField(primary_key=True)
club = models.ForeignKey(
Club_info, on_delete=models.CASCADE, max_length=50, null=True
Expand Down
16 changes: 9 additions & 7 deletions FusionIIIT/applications/gymkhana/templatetags/voters_tag.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
from django import template
import re

register = template.Library()

toggel = False


## A tag function to find whether to show the poll to the user or not
@register.simple_tag
def validate(user, groups):

roll = user.username[:4]
roll = user.username[:3]
branch = user.extrainfo.department.name
print(groups)
if roll in groups.keys():
if groups[roll][0] == 'All':
if groups[roll][0] == "All":
return True
else:
if branch in groups[roll]:
return True
return True
else:
return False
return False
else:
return False



@register.simple_tag
def result():
return toggel
return toggel
Loading