# Path: web/Model/database.py
# class Members(db.Model):
#     __bind_key__ = 'activity'
#     sid = db.Column(db.Integer, primary_key=True, autoincrement=True)
#     name = db.Column(db.Text)
#     stu_code = db.Column(db.Text)
#     qq = db.Column(db.Text)
#     phone = db.Column(db.Text)
#     team = db.Column(db.Text, default="")
#     activity = db.Column(db.VARCHAR(10), db.ForeignKey('activities.activity_name'))
# 
#     __has_submitted = None
# 
#     def __init__(self, name, stu_code, qq, phone, activity):
#         self.name = name
#         self.stu_code = stu_code
#         self.qq = qq
#         self.phone = phone
#         self.activity = activity
# 
#     def get_id(self):
#         return self.sid
# 
#     def get_act_name(self):
#         return self.activity
# 
#     @property
#     def team_str(self):
#         if self.team is None:
#             return ""
#         return self.team
# 
#     @property
#     def has_submit(self):
#         if self.__has_submitted is None:
#             member_submit_his = UploadHistory.query.filter_by(activity=self.activity, sid=self.sid).first()
#             self.__has_submitted = member_submit_his is not None
#         return self.__has_submitted
# 
#     def __repr__(self):
#         return "{0} {1}".format(self.name, self.stu_code)
# 
# Path: web/Model/RegChecks.py
# def check_acatvity(name):
#     act = Activities.query.filter_by(activity_name=name).first()
#     if not act:
#         abort(404)
#     return act


import functools
from flask import session, flash, redirect, url_for, abort
from web.Model.database import Members
from web.Model.RegChecks import check_acatvity




def login_required(func):
    @functools.wraps(func)
    def wrapper(*args, **kw):

# Path: web/Model/database.py
# class Members(db.Model):
#     __bind_key__ = 'activity'
#     sid = db.Column(db.Integer, primary_key=True, autoincrement=True)
#     name = db.Column(db.Text)
#     stu_code = db.Column(db.Text)
#     qq = db.Column(db.Text)
#     phone = db.Column(db.Text)
#     team = db.Column(db.Text, default="")
#     activity = db.Column(db.VARCHAR(10), db.ForeignKey('activities.activity_name'))
# 
#     __has_submitted = None
# 
#     def __init__(self, name, stu_code, qq, phone, activity):
#         self.name = name
#         self.stu_code = stu_code
#         self.qq = qq
#         self.phone = phone
#         self.activity = activity
# 
#     def get_id(self):
#         return self.sid
# 
#     def get_act_name(self):
#         return self.activity
# 
#     @property
#     def team_str(self):
#         if self.team is None:
#             return ""
#         return self.team
# 
#     @property
#     def has_submit(self):
#         if self.__has_submitted is None:
#             member_submit_his = UploadHistory.query.filter_by(activity=self.activity, sid=self.sid).first()
#             self.__has_submitted = member_submit_his is not None
#         return self.__has_submitted
# 
#     def __repr__(self):
#         return "{0} {1}".format(self.name, self.stu_code)
# 
# Path: web/Model/RegChecks.py
# def check_acatvity(name):
#     act = Activities.query.filter_by(activity_name=name).first()
#     if not act:
#         abort(404)
#     return act


# Path: web/Model/SimpleLoginCheck.py
import functools
from flask import session, flash, redirect, url_for, abort
from web.Model.database import Members
from web.Model.RegChecks import check_acatvity





def login_required(func):
    @functools.wraps(func)
    def wrapper(*args, **kw):

        act_name = kw.get('activity')