diff --git a/smash/db_scripts/create_dummy_data.py b/smash/db_scripts/create_dummy_data.py index c197b5100007e8c8ae382511e24005a331b37f2b..42bbd0445208e94260760dca6ed35229ffdc2c83 100644 --- a/smash/db_scripts/create_dummy_data.py +++ b/smash/db_scripts/create_dummy_data.py @@ -3,7 +3,7 @@ import os, sys sys.path.append(sys.path.append(os.path.join(os.path.dirname(__file__), '..'))) #run script as it was on parent folder from django.conf import settings from django.core.files import File # you need this somewhere -import urllib +import urllib.request, urllib.parse, urllib.error from django.core.files.uploadedfile import SimpleUploadedFile import django import datetime @@ -134,7 +134,7 @@ class smashProvider(BaseProvider): # availability def createSmashAvailabilities(self): for worker in self.alreadyCreatedWorkers: - for weekday in set(choice(range(1, 6), 4)): + for weekday in set(choice(list(range(1, 6)), 4)): availability = self.createSmashAvailability( worker=worker, day_number=weekday) @@ -142,11 +142,11 @@ class smashProvider(BaseProvider): if worker is None: worker = choice(self.alreadyCreatedWorkers) if day_number is None: - day_number = choice(range(1, 6)) + day_number = choice(list(range(1, 6))) if available_from is None: - available_from = '{}:00'.format(choice(range(8, 10))) + available_from = '{}:00'.format(choice(list(range(8, 10)))) if available_till is None: - available_till = '{}:00'.format(choice(range(13, 18))) + available_till = '{}:00'.format(choice(list(range(13, 18)))) availability, _ = Availability.objects.update_or_create(person=worker, day_number=day_number, @@ -172,8 +172,8 @@ class smashProvider(BaseProvider): duration = sum([app.default_duration for app in appointment_types]) appointment_start_date = fake.date_time_between(start_date=visit_start_date, end_date=visit_end_date, tzinfo=today.tzinfo) - hour = choice(range(9, 18)) - minute = choice(range(0, 30, 5)) + hour = choice(list(range(9, 18))) + minute = choice(list(range(0, 30, 5))) # ensure the time is between office hours appointment_start_date = appointment_start_date.replace( hour=hour, minute=minute, tzinfo=today.tzinfo) @@ -231,7 +231,7 @@ class smashProvider(BaseProvider): return set(choice(self.alreadyCreatedAppointmentTypes, n)) def createSmashAppointmentTypes(self, n_max=5): - return [self.createSmashAppointmentType() for _ in xrange(n_max)] + return [self.createSmashAppointmentType() for _ in range(n_max)] def createSmashAppointmentType(self, code=None, default_duration=10, rest_time=5, description=None): if code is None: @@ -321,15 +321,15 @@ class smashProvider(BaseProvider): return item def getSmashAlreadyCreatedItems(self, max_n=3): - if len(self.alreadyCreatedItems.keys()) == 0: + if len(list(self.alreadyCreatedItems.keys())) == 0: self.createSmashItems() - keys = set(choice(self.alreadyCreatedItems.keys(), max_n)) + keys = set(choice(list(self.alreadyCreatedItems.keys()), max_n)) return [self.alreadyCreatedItems[key] for key in keys] # room def createSmashRooms(self, n=4): - return [self.createSmashRoom() for _ in xrange(n)] + return [self.createSmashRoom() for _ in range(n)] def createSmashRoom(self, equipment=None, owner=None, address=None, city=None, room_number=None, floor=None, is_vehicle=None): ''' @@ -343,7 +343,7 @@ class smashProvider(BaseProvider): ''' if equipment is None: item = self.fake.word( - ext_word_list=self.alreadyCreatedItems.keys()) + ext_word_list=list(self.alreadyCreatedItems.keys())) equipment = self.getSmashAlreadyCreatedItems() if owner is None: @@ -358,10 +358,10 @@ class smashProvider(BaseProvider): city = self.fake.word(ext_word_list=self.cities) if room_number is None: - room_number = choice(range(10), 1)[0] # choice returns a list + room_number = choice(list(range(10)), 1)[0] # choice returns a list if floor is None: - floor = choice(range(10), 1)[0] + floor = choice(list(range(10)), 1)[0] if is_vehicle is None: is_vehicle = self.fake.boolean(chance_of_getting_true=25) @@ -404,7 +404,7 @@ class smashProvider(BaseProvider): Returns a list of tuples (subject, study_subject) ''' study = Study.objects.filter(id=GLOBAL_STUDY_ID)[0] - return [self.createSmashStudySubject(study=study) for _ in xrange(n)] + return [self.createSmashStudySubject(study=study) for _ in range(n)] def createSmashStudySubject(self, nd_number=None, subject=None, study=None, postponed=None, datetime_contact_reminder=None, type=None, default_location=None, flying_team=None, @@ -528,11 +528,11 @@ class smashProvider(BaseProvider): first_name = self.fake.first_name().lower() last_name = self.fake.last_name().lower() if username is None: - username = u'{}_{}'.format(first_name, last_name) + username = '{}_{}'.format(first_name, last_name) username = unidecode.unidecode(username).lower().replace(' ', '_') if email is None: - email = u'{}.{}@smash.lu'.format(first_name, last_name) + email = '{}.{}@smash.lu'.format(first_name, last_name) email = unidecode.unidecode(email) # create user defaults = {'email': email, 'password': password} @@ -550,7 +550,7 @@ class smashProvider(BaseProvider): Returns a list of tuples (user, worker, workerStuyRole) ''' logger.info('creating Smash Worker...') - return [self.createSmashWorker() for _ in xrange(n)] + return [self.createSmashWorker() for _ in range(n)] def createSmashWorker(self, first_name=None, last_name=None, username=None, email=None, specialization=None, unit=None, phone_number=None, password='password1234', role=None, @@ -576,11 +576,11 @@ class smashProvider(BaseProvider): last_name = self.fake.last_name() if username is None: - username = u'{}_{}'.format( + username = '{}_{}'.format( first_name, last_name).lower().replace(' ', '_') if email is None: - email = u'{}.{}@smash.lu'.format(first_name, last_name) + email = '{}.{}@smash.lu'.format(first_name, last_name) if specialization is None: specialization = self.getSmashSpecialization() @@ -679,7 +679,7 @@ class smashProvider(BaseProvider): Returns a list of Language objects. ''' - if len(self.alreadyCreatedLanguages.keys()) == 0: + if len(list(self.alreadyCreatedLanguages.keys())) == 0: self.createSmashLanguages() languages = choice(self.languages, max_n, p=self.languages_prob) @@ -688,11 +688,11 @@ class smashProvider(BaseProvider): # locations def getAlreadyCreatedSmashLocation(self): - return self.random_element(self.alreadyCreatedLocations.values()) + return self.random_element(list(self.alreadyCreatedLocations.values())) def createSmashLocations(self, n=5): logger.info('creating Smash Locations...') - return [self.createSmashLocation() for _ in xrange(n)] + return [self.createSmashLocation() for _ in range(n)] def createSmashLocation(self, city=None, color=None, prefix=None): if city is None: @@ -712,10 +712,10 @@ class smashProvider(BaseProvider): return location def getAllCreatedLocations(self): - return self.alreadyCreatedLocations.values() + return list(self.alreadyCreatedLocations.values()) def getAllCreatedLanguages(self): - return self.alreadyCreatedLanguages.values() + return list(self.alreadyCreatedLanguages.values()) if __name__ == "__main__": if not os.path.exists(MEDIA_ROOT): @@ -736,6 +736,6 @@ if __name__ == "__main__": fake.createSmashAvailabilities() fake.createSmashStudySubjects() fake.createSmashAppointments() - fake.createSmashWorker(first_name=u'System', last_name=u'Admin', - email=u'carlos.vega@uni.lu', role=ROLE_CHOICES_TECHNICIAN, password='smashtest007', + fake.createSmashWorker(first_name='System', last_name='Admin', + email='carlos.vega@uni.lu', role=ROLE_CHOICES_TECHNICIAN, password='smashtest007', locations=fake.getAllCreatedLocations(), languages=fake.getAllCreatedLanguages(), is_super=True) diff --git a/smash/db_scripts/fix_screening_numbers.py b/smash/db_scripts/fix_screening_numbers.py index d1960644fc8a221dbbc33957860d1c96b96bf4de..6deb38869193ae4fba37533066c0f92ec40e2912 100644 --- a/smash/db_scripts/fix_screening_numbers.py +++ b/smash/db_scripts/fix_screening_numbers.py @@ -10,24 +10,24 @@ from web.models import StudySubject logging.basicConfig(handlers=[logging.FileHandler('log.txt', 'w', 'utf-8')], level=logging.DEBUG) if len(sys.argv) < 2: - logging.warn(u'Please, execute the program as: python {} file_path.xlsx'.format(sys.argv[0])) + logging.warn('Please, execute the program as: python {} file_path.xlsx'.format(sys.argv[0])) sys.exit(1) file = sys.argv[1] if not os.path.isfile(file): - logging.warn(u'Please, execute the program with a valid file path.') + logging.warn('Please, execute the program with a valid file path.') sys.exit(1) df = pd.read_csv(file, names=['Last Name', 'First Name', 'Screening'], encoding='utf-8') for index, row in df.iterrows(): s = StudySubject.objects.filter(subject__first_name=row['First Name'], subject__last_name=row['Last Name']) if len(s) == 0: - logging.warn(u'NO RESULTS for {} {}'.format(row['First Name'], row['Last Name'])) + logging.warn('NO RESULTS for {} {}'.format(row['First Name'], row['Last Name'])) elif len(s) > 1: - logging.warn(u'TOO MANY RESULTS for {} {}'.format(row['First Name'], row['Last Name'])) + logging.warn('TOO MANY RESULTS for {} {}'.format(row['First Name'], row['Last Name'])) else: - logging.info(u'UPDATING {} {} with screening_number {} with new value: {}'.format(row['First Name'], row['Last Name'], s[0].screening_number, row['Screening'])) + logging.info('UPDATING {} {} with screening_number {} with new value: {}'.format(row['First Name'], row['Last Name'], s[0].screening_number, row['Screening'])) s[0].screening_number = row['Screening'] s[0].save() s = StudySubject.objects.filter(subject__first_name=row['First Name'], subject__last_name=row['Last Name']) - logging.info(u'UPDATED {} {}. Current value: {}'.format(row['First Name'], row['Last Name'], s[0].screening_number)) + logging.info('UPDATED {} {}. Current value: {}'.format(row['First Name'], row['Last Name'], s[0].screening_number)) \ No newline at end of file diff --git a/smash/db_scripts/import_file.py b/smash/db_scripts/import_file.py index 50a70f285b1b6a8dbb185560427dfc4aaf5fc1df..71c8486f8c19e26e4a89516bb217d2366c29bb2c 100644 --- a/smash/db_scripts/import_file.py +++ b/smash/db_scripts/import_file.py @@ -121,12 +121,12 @@ Column Converter Functions def parse_voucher_reference(vr): vr = vr.strip() #strip spaces - return vr.split('\n') if vr != u'' else [] #if empty string then return empty list, otherwise split by break line + return vr.split('\n') if vr != '' else [] #if empty string then return empty list, otherwise split by break line def parse_voucher_type(vt): vt = '' if 'NONE' in vt.upper() else vt #if vt includes none in any form, then return empty vt = vt.strip() #strip spaces - return vt.split('\n') if vt != u'' else [] #if empty string then return empty list, otherwise split by break line + return vt.split('\n') if vt != '' else [] #if empty string then return empty list, otherwise split by break line def parse_boolean(boolean_Y_N): ''' @@ -141,8 +141,8 @@ def parse_boolean(boolean_Y_N): else: return False except Exception as e: - logging.warn(u'parse_boolean failed for {}.'.format(boolean_Y_N)) - logging.warn(u'{} {}'.format(e.message, e.args)) + logging.warn('parse_boolean failed for {}.'.format(boolean_Y_N)) + logging.warn('{} {}'.format(e.message, e.args)) return False # birth date @@ -233,11 +233,11 @@ locale_table = { language_translation_table = { # deletions - ord(u')'): None, - ord(u'('): None, - ord(u' '): None, + ord(')'): None, + ord('('): None, + ord(' '): None, # replacements - ord(u','): u';' + ord(','): ';' } @@ -249,7 +249,7 @@ def apply_column_languages(languages): languages = languages.strip() if type(languages) != float and len(languages) > 0: # replacements and transformations - languages = unicode(languages).upper().strip().translate( + languages = str(languages).upper().strip().translate( language_translation_table) new_list = [] for language in languages.split(';'): @@ -277,9 +277,9 @@ def apply_column_country(country): try: return country_table[country] except: - if country in country_table.values(): + if country in list(country_table.values()): return country - logging.warn(u'Invalid Country: {}'.format(country)) + logging.warn('Invalid Country: {}'.format(country)) return country ''' @@ -318,22 +318,22 @@ def add_subject_vouchers(voucher_reference, referral, voucher_types, subject_nd_ # create workerStudyRole workerStudyRole, _ = WorkerStudyRole.objects.update_or_create(worker=usage_partner, study_id=GLOBAL_STUDY_ID, name=ROLE_CHOICES_VOUCHER_PARTNER) - usage_partner.voucher_types.set(voucher_types.values()) + usage_partner.voucher_types.set(list(voucher_types.values())) usage_partner.save() if created: - logging.warn(u'New Voucher Partner created: {}'.format(voucher_partner)) + logging.warn('New Voucher Partner created: {}'.format(voucher_partner)) vt = VoucherType.objects.get(code=voucher_type) if nd_number != subject_nd_number: - logging.warn(u'voucher reference nd_number is not the same! {} != {}'.format(nd_number, subject_nd_number)) + logging.warn('voucher reference nd_number is not the same! {} != {}'.format(nd_number, subject_nd_number)) study_subject = StudySubject.objects.get(nd_number=subject_nd_number) voucher, created = Voucher.objects.update_or_create(number=voucher_reference, issue_date=issue_date, expiry_date=expiry_date, voucher_type=vt, study_subject=study_subject, status=VOUCHER_STATUS_IN_USE, usage_partner=usage_partner, issue_worker=referral) - logging.warn(u'New Voucher added: {}'.format(voucher_reference)) + logging.warn('New Voucher added: {}'.format(voucher_reference)) return voucher # create voucher types @@ -353,7 +353,7 @@ def create_voucher_code(description): def create_voucher_types(voucher_types_dict, study): voucher_types = {} - for name, code in voucher_types_dict.items(): + for name, code in list(voucher_types_dict.items()): voucher_type, _ = VoucherType.objects.update_or_create(code=code, description=name, study=study) voucher_types[name] = voucher_type return voucher_types @@ -361,8 +361,8 @@ def create_voucher_types(voucher_types_dict, study): # create appointment types def create_appointment_types(assessments): appointmentTypes = [] - for name, duration in assessments.items(): - code = filter(str.isupper, name) + for name, duration in list(assessments.items()): + code = list(filter(str.isupper, name)) appointmentType, _ = AppointmentType.objects.update_or_create( code=code, default_duration=duration, description=name) appointmentType.save() @@ -379,7 +379,7 @@ def create_languages(languages_cell): lang, created = Language.objects.get_or_create( name=language, locale=locale_table.get(language,(None, None))[0]) if created: - logging.warn(u'New Language added: {}'.format(language)) + logging.warn('New Language added: {}'.format(language)) lang.save() @@ -388,7 +388,7 @@ def create_languages(languages_cell): language_flags[language]) basename = os.path.basename(src) dst = os.path.join(MEDIA_ROOT, basename) - logging.warn(u'Copying file {} to {}'.format(src, dst)) + logging.warn('Copying file {} to {}'.format(src, dst)) copyfile(src, dst) # .save(basename, File(open(dst, 'rb'))) #SimpleUploadedFile(name=path, content=open(path, 'rb').read(), content_type='image/png') lang.image = basename @@ -401,7 +401,7 @@ def create_languages(languages_cell): def parse_row(index, row, visit_columns, appointmentTypes, voucher_types, lcsb_worker): # Languages if len(row['LANGUAGES']) == 0 and len(row['PREFERED WRITEN LANGUAGE']) == 0: - logging.warn(u'No Languages available for row {} {}'.format(index, row['FIRST NAME']+row['LAST NAME'])) + logging.warn('No Languages available for row {} {}'.format(index, row['FIRST NAME']+row['LAST NAME'])) elif len(row['LANGUAGES']) == 0 and len(row['PREFERED WRITEN LANGUAGE']) > 0: row['LANGUAGES'] = row['PREFERED WRITEN LANGUAGE'] elif len(row['LANGUAGES']) > 0 and len(row['PREFERED WRITEN LANGUAGE']) == 0: @@ -418,7 +418,7 @@ def parse_row(index, row, visit_columns, appointmentTypes, voucher_types, lcsb_w country = row['COUNTRY'] country, created = Country.objects.get_or_create(name=country) if created: - logging.warn(u'New Country added: {}'.format(row['COUNTRY'])) + logging.warn('New Country added: {}'.format(row['COUNTRY'])) country.save() # Location and Flying Team @@ -431,20 +431,20 @@ def parse_row(index, row, visit_columns, appointmentTypes, voucher_types, lcsb_w location, created = Location.objects.get_or_create( name=DEFAULT_LOCATION, prefix=prefix) if created: - logging.warn(u'New location added: {}'.format(DEFAULT_LOCATION)) + logging.warn('New location added: {}'.format(DEFAULT_LOCATION)) location.save() else: prefix = 'F' location, created = Location.objects.get_or_create( name='Flying Team', prefix=prefix) if created: - logging.warn(u'New location added: Flying Team') + logging.warn('New location added: Flying Team') location.save() # Create Flying Team ft, created = FlyingTeam.objects.get_or_create( place=row['LOCATION OF FT']) if created: - logging.warn(u'New Flying Team added: {}'.format( + logging.warn('New Flying Team added: {}'.format( row['LOCATION OF FT'])) ft.save() @@ -452,7 +452,7 @@ def parse_row(index, row, visit_columns, appointmentTypes, voucher_types, lcsb_w # create health partner (Referral) health_partner = None if row['REFERRAL'].strip() != '': - logging.warn(u'Trying to get or create Worker: {}'.format(row['REFERRAL'])) + logging.warn('Trying to get or create Worker: {}'.format(row['REFERRAL'])) health_partner, created = Worker.objects.get_or_create(name=row['REFERRAL']) health_partner.roles.update(name=ROLE_CHOICES_HEALTH_PARTNER) # create workerStudyRole @@ -460,7 +460,7 @@ def parse_row(index, row, visit_columns, appointmentTypes, voucher_types, lcsb_w worker=health_partner, study_id=GLOBAL_STUDY_ID, name=ROLE_CHOICES_HEALTH_PARTNER) health_partner.save() if created: - logging.warn(u'New Health Partner added: {}'.format(row['REFERRAL'])) + logging.warn('New Health Partner added: {}'.format(row['REFERRAL'])) if row['SS NUMBER'] is None: row['SS NUMBER'] = '' @@ -488,7 +488,7 @@ def parse_row(index, row, visit_columns, appointmentTypes, voucher_types, lcsb_w subject.save() if created: - logging.warn(u'New Subject added with SS number: {}'.format(row['SS NUMBER'])) + logging.warn('New Subject added with SS number: {}'.format(row['SS NUMBER'])) # StudySubject study = Study.objects.filter(id=GLOBAL_STUDY_ID)[0] @@ -513,11 +513,11 @@ def parse_row(index, row, visit_columns, appointmentTypes, voucher_types, lcsb_w }) #all study subjects can have all voucher types - studySubject.voucher_types.set(voucher_types.values()) + studySubject.voucher_types.set(list(voucher_types.values())) studySubject.save() if created: - logging.warn(u'New StudySubject added with ND number: {}'.format(nd_number)) + logging.warn('New StudySubject added with ND number: {}'.format(nd_number)) #VOUCHERS voucher_references = row['VOUCHER REFERENCE'] @@ -541,7 +541,7 @@ def parse_row(index, row, visit_columns, appointmentTypes, voucher_types, lcsb_w dtime = datetime.datetime.strptime(date_string, '%d.%m.%Y') return dtime - visit_dates = map(lambda x: parse_visit_date(x), sum(map(date_regex.findall, row[visit_columns].values), [])) + visit_dates = [parse_visit_date(x) for x in sum(list(map(date_regex.findall, row[visit_columns].values)), [])] # get first and last elements of the sorted element datetime_begin, datetime_end = itemgetter(*[0, -1])(sorted(visit_dates)) @@ -552,7 +552,7 @@ def parse_row(index, row, visit_columns, appointmentTypes, voucher_types, lcsb_w subject=studySubject, datetime_begin=datetime_begin, datetime_end=datetime_end, defaults={ 'is_finished': True}) if created: - logging.warn(u'New Visit added for ND number {} starting on {}'.format( + logging.warn('New Visit added for ND number {} starting on {}'.format( nd_number, datetime_begin)) appointment_types = appointmentTypes[:len(set(visit_dates))] #in this case appointment types are incremental @@ -622,7 +622,7 @@ def createWorker(password, email='', username='admin', first_name='LCSB', last_n worker, created = Worker.objects.update_or_create(**worker_args) if created: - logging.warn(u'Added worker. Name: {} first_name: {} last_name: {}'.format(name, first_name, last_name)) + logging.warn('Added worker. Name: {} first_name: {} last_name: {}'.format(name, first_name, last_name)) locations = Location.objects.all() worker.locations.set(locations) @@ -641,11 +641,11 @@ def createWorker(password, email='', username='admin', first_name='LCSB', last_n if __name__ == '__main__': logging.basicConfig(level=logging.DEBUG) if len(sys.argv) < 2: - logging.warn(u'Please, execute the program as: python {} file_path.xlsx'.format(sys.argv[0])) + logging.warn('Please, execute the program as: python {} file_path.xlsx'.format(sys.argv[0])) sys.exit(1) file = sys.argv[1] if not os.path.isfile(file): - logging.warn(u'Please, execute the program with a valid file path.') + logging.warn('Please, execute the program with a valid file path.') sys.exit(1) admin_password = None @@ -660,7 +660,7 @@ if __name__ == '__main__': pass1 = getpass.getpass('Please type a password for the Admin user: ') pass2 = getpass.getpass('Please type your password again: ') if pass1 != pass2: - print 'Password mismatch, please try again' + print('Password mismatch, please try again') else: pass1 = admin_password lcsb_worker = createWorker(pass1) @@ -690,11 +690,11 @@ if __name__ == '__main__': df = pd.read_excel(file, dtype=object, sheet_name='Voucher Partners') #convert column name to upper case df.columns = [c.upper() for c in df.columns] - logging.warn(u'COLUMNS IN VOUCHER_PARTNER: {}'.format(df.columns)) + logging.warn('COLUMNS IN VOUCHER_PARTNER: {}'.format(df.columns)) df['ROLE'] = df['ROLE'].apply(parse_role) - logging.warn(u'Voucher Partners') + logging.warn('Voucher Partners') for index, row in df.iterrows(): - logging.warn(u'Voucher Partner: {}'.format(row['NAME'])) + logging.warn('Voucher Partner: {}'.format(row['NAME'])) worker = createWorker(None, email='', username=None, first_name='', last_name='', specialization=row['ROLE'], role_name=row['ROLE'], unit='CHL', languages=[], name=row['NAME'], comment=row.get('COMMENT', '')) if type(row['OFFER']) != float: @@ -705,24 +705,24 @@ if __name__ == '__main__': voucher_type_codes.add(code) voucher_type, created = VoucherType.objects.update_or_create(description=offer.title(), study=study, code=code) if created: - logging.warn(u'Voucher type created: {} ({})'.format(offer, code)) + logging.warn('Voucher type created: {} ({})'.format(offer, code)) voucher_types.append(voucher_type) worker.voucher_types.set(voucher_types) worker.save() #READ FIRST SHEET df = pd.read_excel(file, dtype=object, sheet_name='Subjects') - df = df.fillna('').astype(unicode) + df = df.fillna('').astype(str) df.columns = [c.upper().strip() for c in df.columns] - logging.warn(u'COLUMNS IN Subjects: {}'.format(df.columns)) + logging.warn('COLUMNS IN Subjects: {}'.format(df.columns)) # make transformations - for column, function in converters.items(): + for column, function in list(converters.items()): logging.warn(column) df[column] = df[column].apply(function) # get visits columns regex = re.compile(r'\(V\d\)') # - visit_columns = filter(regex.search, df.columns) + visit_columns = list(filter(regex.search, df.columns)) assessments = OrderedDict([('Cognitive Test', 180), ('Risk Factor', 120), ('Voucher Distribution', 120), ('Follow Up', 90)]) diff --git a/smash/smash/settings.py b/smash/smash/settings.py index a327ecd64d4221f67bb45935c18143dd119c462f..619079d4959cebf310521e4148688fc0adb23c56 100644 --- a/smash/smash/settings.py +++ b/smash/smash/settings.py @@ -134,4 +134,4 @@ LOGOUT_REDIRECT_URL = 'web.views.appointments' # Used for LoginRequiredMiddleware STRONGHOLD_PUBLIC_NAMED_URLS = (LOGIN_URL,) -from local_settings import * +from .local_settings import * diff --git a/smash/web/admin.py b/smash/web/admin.py index 7d7611b9d71d2767d962fbd1fdd258bb5dbdda0e..6fce54fc40b50ea3a75960f36c6b53114360a0f8 100644 --- a/smash/web/admin.py +++ b/smash/web/admin.py @@ -1,6 +1,6 @@ from django.contrib import admin -from models import StudySubject, Item, Room, AppointmentType, Language, Location, Worker, FlyingTeam, Availability, \ +from .models import StudySubject, Item, Room, AppointmentType, Language, Location, Worker, FlyingTeam, Availability, \ Holiday, Visit, Appointment, StudyColumns, StudySubjectList, StudyVisitList, VisitColumns, SubjectColumns diff --git a/smash/web/algorithm/__init__.py b/smash/web/algorithm/__init__.py index defa4efb79e533df509ea627c72f61a3e4e001b1..b988ae638712aabe34bce057d712ed7b267d3a0e 100644 --- a/smash/web/algorithm/__init__.py +++ b/smash/web/algorithm/__init__.py @@ -1,4 +1,4 @@ -from luhn_algorithm import LuhnAlgorithm -from verhoeff_alogirthm import VerhoeffAlgorithm +from .luhn_algorithm import LuhnAlgorithm +from .verhoeff_alogirthm import VerhoeffAlgorithm __all__ = [VerhoeffAlgorithm, LuhnAlgorithm] diff --git a/smash/web/api_views/__init__.py b/smash/web/api_views/__init__.py index e23cf4209db9249f6a3c07942770e0f89fee5a1c..8fa4a97a2a5f44f594ebf6e4c0f2d16fac335d2e 100644 --- a/smash/web/api_views/__init__.py +++ b/smash/web/api_views/__init__.py @@ -1,6 +1,6 @@ # coding=utf-8 -import appointment_type -import location -import subject -import worker +from . import appointment_type +from . import location +from . import subject +from . import worker diff --git a/smash/web/api_views/appointment.py b/smash/web/api_views/appointment.py index 8a60dc5949e089291bb09a22f18c1fbf600fb8e5..4c2fa7524289da5625dd1ba13165f658bd0dd83f 100644 --- a/smash/web/api_views/appointment.py +++ b/smash/web/api_views/appointment.py @@ -184,11 +184,10 @@ def serialize_appointment(appointment): nd_number = study_subject.nd_number screening_number = study_subject.screening_number subject_type = study_subject.get_type_display() - phone_numbers = ", ".join(filter(None, - [study_subject.subject.phone_number, study_subject.subject.phone_number_2, - study_subject.subject.phone_number_3])) + phone_numbers = ", ".join([_f for _f in [study_subject.subject.phone_number, study_subject.subject.phone_number_2, + study_subject.subject.phone_number_3] if _f]) appointment_type_names = ", ".join( - [unicode(appointment_type_codes) for appointment_type_codes in appointment.appointment_types.all()]) + [str(appointment_type_codes) for appointment_type_codes in appointment.appointment_types.all()]) else: title = appointment.comment diff --git a/smash/web/api_views/daily_planning.py b/smash/web/api_views/daily_planning.py index 0b6589660e30ff3dc6005b24ecbaddbadee35f04..8a3bbd2a47126774680f0b39385b2cf7f9b181eb 100644 --- a/smash/web/api_views/daily_planning.py +++ b/smash/web/api_views/daily_planning.py @@ -248,14 +248,14 @@ def get_generic_appointment_events(request, date, include_all=False): 'link_who': appointment.worker_assigned_id, 'link_end': link_end, 'location': str(appointment.location), - 'flying_team_location': unicode(appointment.flying_team), + 'flying_team_location': str(appointment.flying_team), 'appointment_start': appointment.datetime_when.replace(tzinfo=None, hour=7, minute=0), 'appointment_end': appointment.datetime_when.replace(tzinfo=None, hour=19, minute=0), } appointment_events = result[appointment.location_id]['events'] appointment_events.append(event) - return result.values() + return list(result.values()) def events(request, date, include_all=False): @@ -286,7 +286,7 @@ def events(request, date, include_all=False): flag_set.add(default_language.image.url) subject = { - 'name': unicode(appointment_subject), + 'name': str(appointment_subject), 'id': appointment_subject.id, 'appointment_id': appointment.id, 'color': RANDOM_COLORS[i], @@ -316,14 +316,14 @@ def events(request, date, include_all=False): 'status': link.appointment.status, 'short_title': link.appointment_type.code, 'duration': build_duration(link.appointment_type.default_duration), - 'subject': unicode(appointment_subject), + 'subject': str(appointment_subject), 'id': '{}-{}'.format(i, j), 'link_id': link.id, 'link_when': link_when, 'link_who': link.worker_id, 'link_end': link_end, 'location': str(appointment.location), - 'flying_team_location': unicode(appointment.flying_team), + 'flying_team_location': str(appointment.flying_team), 'appointment_start': appointment.datetime_when.replace(tzinfo=None), 'appointment_end': appointment.datetime_when.replace(tzinfo=None, hour=19, minute=0), } @@ -341,7 +341,7 @@ def events(request, date, include_all=False): holidays = holidays + get_holidays(worker, date) return JsonResponse({ - "data": subjects.values(), + "data": list(subjects.values()), "generic": generic_appointment_events, 'availabilities': availabilities, 'holidays': holidays diff --git a/smash/web/api_views/serialization_utils.py b/smash/web/api_views/serialization_utils.py index 7df976992e9a300b7472cb68df560fc52ab4dc53..5cf59a19882a3472600b97c581a686e48bc99ac8 100644 --- a/smash/web/api_views/serialization_utils.py +++ b/smash/web/api_views/serialization_utils.py @@ -33,14 +33,14 @@ def virus_test_to_str(test, date): def flying_team_to_str(flying_team): result = "" if flying_team is not None: - result = unicode(flying_team) + result = str(flying_team) return result def location_to_str(location): result = "" if location is not None: - result = unicode(location.name) + result = str(location.name) return result diff --git a/smash/web/api_views/subject.py b/smash/web/api_views/subject.py index bc00eaf01e173f0c3fcf088d7d6f78dce7dc1214..946001644eefa285c19517d3ce72b04d915b8407 100644 --- a/smash/web/api_views/subject.py +++ b/smash/web/api_views/subject.py @@ -84,11 +84,11 @@ def get_subject_columns(request, subject_list_type): visit_from_zero = ConfigurationItem.objects.get(type=VISIT_SHOW_VISIT_NUMBER_FROM_ZERO).value # True values are y, yes, t, true, on and 1; false values are n, no, f, false, off and 0. if strtobool(visit_from_zero): - virus_visit_numbers = range(0, 5) - visit_numbers = range(0, study.visits_to_show_in_subject_list + 0) + virus_visit_numbers = list(range(0, 5)) + visit_numbers = list(range(0, study.visits_to_show_in_subject_list + 0)) else: - virus_visit_numbers = range(1, 5 + 1) - visit_numbers = range(1, study.visits_to_show_in_subject_list + 1) + virus_visit_numbers = list(range(1, 5 + 1)) + visit_numbers = list(range(1, study.visits_to_show_in_subject_list + 1)) for one_based_idx, virus_visit_number in enumerate(virus_visit_numbers, 1): add_column(result, @@ -172,10 +172,10 @@ def get_subjects_order(subjects_to_be_ordered, order_column, order_direction, co elif order_column == "referral": result = subjects_to_be_ordered.order_by(order_direction + 'referral') elif order_column == "screening_number": - if u'screening_number' not in column_filters: + if 'screening_number' not in column_filters: pattern = None else: - pattern = column_filters[u'screening_number'] + pattern = column_filters['screening_number'] result = subjects_to_be_ordered.all() result = sorted(result, key=lambda t: t.sort_matched_screening_first(pattern, reverse=order_direction == '-'), reverse=order_direction == '-') @@ -429,7 +429,7 @@ def subjects(request, type): # noinspection PyUnusedLocal def types(request): data = [{"id": subject_type_id, "name": subject_type_name} for subject_type_id, subject_type_name in - SUBJECT_TYPE_CHOICES.items()] + list(SUBJECT_TYPE_CHOICES.items())] return JsonResponse({ "types": data }) @@ -483,7 +483,7 @@ def serialize_subject(study_subject): contact_attempts = ContactAttempt.objects.filter(subject=study_subject).order_by("-datetime_when") if len(contact_attempts) > 0: last_contact_attempt = contact_attempts[0] - last_contact_attempt_string = serialize_datetime(last_contact_attempt.datetime_when) + "<br/>" + unicode( + last_contact_attempt_string = serialize_datetime(last_contact_attempt.datetime_when) + "<br/>" + str( last_contact_attempt.worker) + "<br/> Success: " + bool_to_yes_no( last_contact_attempt.success) + "<br/>" + last_contact_attempt.comment diff --git a/smash/web/api_views/visit.py b/smash/web/api_views/visit.py index 14c7021ffa5a1e07ab9aebad6d6dad88eebdb213..606d1ef11cce5135327947ad4d5a564ddd6692eb 100644 --- a/smash/web/api_views/visit.py +++ b/smash/web/api_views/visit.py @@ -225,7 +225,7 @@ def visits(request, visit_list_type): def appointment_types_to_str(appointment_types): result = "" for appointment_type in appointment_types: - result += unicode(appointment_type.code) + ", " + result += str(appointment_type.code) + ", " return result diff --git a/smash/web/api_views/worker.py b/smash/web/api_views/worker.py index 7b7d99e84103e4939ca4544e733d82dfdc7f5b9e..c956782d4377bb8d365a58dd892aaefcdf429ac0 100644 --- a/smash/web/api_views/worker.py +++ b/smash/web/api_views/worker.py @@ -34,12 +34,12 @@ def workers_for_daily_planning(request): today = timezone.now() start_date=datetime.datetime.strptime(start_date, '%Y-%m-%d').replace(tzinfo=today.tzinfo) for worker in workers: - role = unicode(worker.roles.filter(study_id=GLOBAL_STUDY_ID)[0].role) + role = str(worker.roles.filter(study_id=GLOBAL_STUDY_ID)[0].role) worker_dict_for_json = { 'id': worker.id, 'flags' : [language.image.url for language in worker.languages.all() if language.image], 'availability': worker.availability_percentage(start_date=start_date), - 'title': u"{} ({})".format(unicode(worker), role[:1].upper()), + 'title': "{} ({})".format(str(worker), role[:1].upper()), 'role': role } workers_list_for_json.append(worker_dict_for_json) diff --git a/smash/web/apps.py b/smash/web/apps.py index 8452b69a9d59a50f76645b5aaf01993bcdda6281..785a1561986d539cbe024fdb0ac619b81433ccaa 100644 --- a/smash/web/apps.py +++ b/smash/web/apps.py @@ -1,4 +1,4 @@ -from __future__ import unicode_literals + from django.apps import AppConfig diff --git a/smash/web/debug_utils.py b/smash/web/debug_utils.py index fa04ebe448725534d015e406ff436b6e275f923b..ef69a57c1dea25e3a50b5f7597e0e937217f6fef 100644 --- a/smash/web/debug_utils.py +++ b/smash/web/debug_utils.py @@ -13,7 +13,7 @@ def timeit(method): name = kw.get('log_name', method.__name__.upper()) kw['log_time'][name] = int((te - ts) * 1000) else: - print '%r %2.2f ms' % \ - (method.__name__, (te - ts) * 1000) + print('%r %2.2f ms' % \ + (method.__name__, (te - ts) * 1000)) return result return timed \ No newline at end of file diff --git a/smash/web/docx_helper.py b/smash/web/docx_helper.py index 8a07243c0f9a14207d6eaa37be4b81b3457ca344..d8d52829af625780328cb76f61e09d3fa8e306bc 100644 --- a/smash/web/docx_helper.py +++ b/smash/web/docx_helper.py @@ -13,7 +13,7 @@ def process_file(path_to_docx, path_to_new_docx, changes_to_apply): argument. """ doc = Document(path_to_docx) - for placeholder, replacement in changes_to_apply.items(): + for placeholder, replacement in list(changes_to_apply.items()): for paragraph in doc.paragraphs: if placeholder in paragraph.text: paragraph.text = paragraph.text.replace(placeholder, replacement) diff --git a/smash/web/forms/__init__.py b/smash/web/forms/__init__.py index 96072e9169bda1d90cd00e20ca7306831b4b20f8..698f27b4f65ea900c87815a3ffa6fb3b6f08697d 100644 --- a/smash/web/forms/__init__.py +++ b/smash/web/forms/__init__.py @@ -1,13 +1,13 @@ -from study_forms import StudyEditForm, StudyNotificationParametersEditForm, StudyColumnsEditForm, StudyRedCapColumnsEditForm -from worker_form import WorkerForm -from forms import VisitDetailForm, \ +from .study_forms import StudyEditForm, StudyNotificationParametersEditForm, StudyColumnsEditForm, StudyRedCapColumnsEditForm +from .worker_form import WorkerForm +from .forms import VisitDetailForm, \ VisitAddForm, KitRequestForm, StatisticsForm, AvailabilityAddForm, \ AvailabilityEditForm, HolidayAddForm -from contact_attempt_forms import ContactAttemptAddForm, ContactAttemptEditForm -from appointment_form import AppointmentDetailForm, AppointmentEditForm, AppointmentAddForm -from study_subject_forms import StudySubjectAddForm, StudySubjectDetailForm, StudySubjectEditForm -from subject_forms import SubjectAddForm, SubjectEditForm, SubjectDetailForm -from voucher_forms import VoucherTypeForm, VoucherTypePriceForm, VoucherForm +from .contact_attempt_forms import ContactAttemptAddForm, ContactAttemptEditForm +from .appointment_form import AppointmentDetailForm, AppointmentEditForm, AppointmentAddForm +from .study_subject_forms import StudySubjectAddForm, StudySubjectDetailForm, StudySubjectEditForm +from .subject_forms import SubjectAddForm, SubjectEditForm, SubjectDetailForm +from .voucher_forms import VoucherTypeForm, VoucherTypePriceForm, VoucherForm __all__ = [StudySubjectAddForm, StudySubjectDetailForm, StudySubjectEditForm, WorkerForm, AppointmentDetailForm, AppointmentEditForm, AppointmentAddForm, VisitDetailForm, VisitAddForm, diff --git a/smash/web/forms/appointment_form.py b/smash/web/forms/appointment_form.py index 48b68aa5cec4dd368f7370307f02f2af688ef121..602486aa8b917674c9cf4cd83ba0e7cd53fef85b 100644 --- a/smash/web/forms/appointment_form.py +++ b/smash/web/forms/appointment_form.py @@ -52,7 +52,7 @@ class AppointmentForm(ModelForm): else: previous_value = '' new_value = self.cleaned_data[field] - description = u'{} changed from "{}" to "{}"'.format(field, previous_value, new_value) + description = '{} changed from "{}" to "{}"'.format(field, previous_value, new_value) p = Provenance(modified_table=Appointment._meta.db_table, modified_table_id=self.instance.id, diff --git a/smash/web/forms/forms.py b/smash/web/forms/forms.py index 805f2e72684e1274bc064633bfa71bafd15a0b7d..be349a491d3beb6a76ecd1c521639f16499cc7c2 100644 --- a/smash/web/forms/forms.py +++ b/smash/web/forms/forms.py @@ -66,7 +66,7 @@ class VisitDetailForm(ModelForm): super(VisitDetailForm, self).__init__(*args, **kwargs) instance = getattr(self, 'instance', None) if instance.is_finished: #set form as readonly - for key in self.fields.keys(): + for key in list(self.fields.keys()): self.fields[key].widget.attrs['readonly'] = True @@ -124,10 +124,10 @@ class StatisticsForm(Form): year_choices = [(START_YEAR_STATISTICS + i, START_YEAR_STATISTICS + i) for i in range(0, number_of_years_for_statistics + 1)] - self.fields['month'] = forms.ChoiceField(choices=MONTHS.items(), initial=month) + self.fields['month'] = forms.ChoiceField(choices=list(MONTHS.items()), initial=month) self.fields['year'] = forms.ChoiceField(choices=year_choices, initial=year) choices = [(-1, "all")] - choices.extend(SUBJECT_TYPE_CHOICES.items()) + choices.extend(list(SUBJECT_TYPE_CHOICES.items())) self.fields['subject_type'] = forms.ChoiceField(choices=choices, initial="-1") visit_from_zero = ConfigurationItem.objects.get(type=VISIT_SHOW_VISIT_NUMBER_FROM_ZERO).value #True values are y, yes, t, true, on and 1; false values are n, no, f, false, off and 0. diff --git a/smash/web/forms/study_subject_forms.py b/smash/web/forms/study_subject_forms.py index 18fbd7aa2fc6274a9f6e0cfd6f24893006cbc784..bce5929d844935d572b90776d8ae5d28d8212e69 100644 --- a/smash/web/forms/study_subject_forms.py +++ b/smash/web/forms/study_subject_forms.py @@ -30,7 +30,7 @@ class StudySubjectForm(ModelForm): visit_from_zero = ConfigurationItem.objects.get(type=VISIT_SHOW_VISIT_NUMBER_FROM_ZERO).value # True values are y, yes, t, true, on and 1; false values are n, no, f, false, off and 0. if strtobool(visit_from_zero): - virus_visit_numbers = range(0, 5) + virus_visit_numbers = list(range(0, 5)) for one_based_idx, virus_visit_number in enumerate(virus_visit_numbers, 1): field = 'virus_test_{}'.format(one_based_idx) self.fields[field].label = 'Visit {} RT-PCR'.format(virus_visit_number) diff --git a/smash/web/forms/voucher_forms.py b/smash/web/forms/voucher_forms.py index 9eaf8ee1bc3b571627a8b9cac259ecc3f0bd24b4..cf567016c9b4735c022e41b3528f5d021859a6c4 100644 --- a/smash/web/forms/voucher_forms.py +++ b/smash/web/forms/voucher_forms.py @@ -41,8 +41,8 @@ class VoucherForm(ModelForm): @staticmethod def _voucher_type_optgroup(subject_voucher_types, all_voucher_types): - subject_voucher_types = set([(vt.id, unicode(vt)) for vt in subject_voucher_types]) - all_voucher_types = set([(vt.id, unicode(vt)) for vt in all_voucher_types]) + subject_voucher_types = set([(vt.id, str(vt)) for vt in subject_voucher_types]) + all_voucher_types = set([(vt.id, str(vt)) for vt in all_voucher_types]) if subject_voucher_types == all_voucher_types: return [(None, 'Please select an option')] + list(all_voucher_types) elif len(subject_voucher_types) == 0: diff --git a/smash/web/forms/worker_form.py b/smash/web/forms/worker_form.py index 2399816ede172a0fcaa23970a55a824739a0a284..25c4cc8df80a06ff60c6da7db42bd03dc45d6ec4 100644 --- a/smash/web/forms/worker_form.py +++ b/smash/web/forms/worker_form.py @@ -79,7 +79,7 @@ class WorkerForm(ModelForm): fields['password'] = forms.CharField(label='Password', widget=forms.PasswordInput) fields['password2'] = forms.CharField(label='Repeat password', widget=forms.PasswordInput) - for key, value in self.fields.items(): + for key, value in list(self.fields.items()): fields[key] = value self.fields = fields diff --git a/smash/web/importer/__init__.py b/smash/web/importer/__init__.py index 7740b827d19252769483d1a62ee8e8be2c9648d5..c1cb4fbf977323af3452024f54f80a4e5c557aef 100644 --- a/smash/web/importer/__init__.py +++ b/smash/web/importer/__init__.py @@ -1,12 +1,12 @@ -from csv_subject_import_reader import CsvSubjectImportReader -from csv_tns_subject_import_reader import TnsCsvSubjectImportReader -from csv_tns_visit_import_reader import TnsCsvVisitImportReader -from exporter import SubjectExporter, VisitExporter -from exporter_cron_job import SubjectExporterCronJob, VisitExporterCronJob -from importer import Importer -from importer_cron_job import SubjectImporterCronJob, VisitImporterCronJob -from subject_import_reader import SubjectImportReader -from warning_counter import MsgCounterHandler +from .csv_subject_import_reader import CsvSubjectImportReader +from .csv_tns_subject_import_reader import TnsCsvSubjectImportReader +from .csv_tns_visit_import_reader import TnsCsvVisitImportReader +from .exporter import SubjectExporter, VisitExporter +from .exporter_cron_job import SubjectExporterCronJob, VisitExporterCronJob +from .importer import Importer +from .importer_cron_job import SubjectImporterCronJob, VisitImporterCronJob +from .subject_import_reader import SubjectImportReader +from .warning_counter import MsgCounterHandler __all__ = [Importer, SubjectImportReader, CsvSubjectImportReader, SubjectImporterCronJob, VisitImporterCronJob, SubjectExporter, VisitExporter, SubjectExporterCronJob, VisitExporterCronJob, TnsCsvSubjectImportReader, diff --git a/smash/web/importer/csv_subject_import_reader.py b/smash/web/importer/csv_subject_import_reader.py index 187b59aba9d98798f8630054828256aa3b80b07f..9f95f0c30c8a751fce177e2c1853d7cc65d70b0f 100644 --- a/smash/web/importer/csv_subject_import_reader.py +++ b/smash/web/importer/csv_subject_import_reader.py @@ -2,7 +2,7 @@ import csv import datetime import logging -from subject_import_reader import SubjectImportReader +from .subject_import_reader import SubjectImportReader from web.models import StudySubject, Subject, Study from web.models.constants import GLOBAL_STUDY_ID diff --git a/smash/web/importer/csv_tns_subject_import_reader.py b/smash/web/importer/csv_tns_subject_import_reader.py index 74ee4b1a90b452707b65943e5f7b22eb2f751a86..f1c88701be041afce8e5f06592c274e1b0acbbf7 100644 --- a/smash/web/importer/csv_tns_subject_import_reader.py +++ b/smash/web/importer/csv_tns_subject_import_reader.py @@ -3,7 +3,7 @@ import datetime import logging import codecs -from subject_import_reader import SubjectImportReader +from .subject_import_reader import SubjectImportReader from ..models import StudySubject, Subject, Study from ..models.constants import GLOBAL_STUDY_ID diff --git a/smash/web/importer/csv_tns_visit_import_reader.py b/smash/web/importer/csv_tns_visit_import_reader.py index 1a6181a3b8255eca5a2fac5a143f04fa16173dd0..ffe50d78b2a4a56bcb1d4db00264dd5e664f16db 100644 --- a/smash/web/importer/csv_tns_visit_import_reader.py +++ b/smash/web/importer/csv_tns_visit_import_reader.py @@ -9,7 +9,7 @@ import traceback import pytz from django.conf import settings -from warning_counter import MsgCounterHandler +from .warning_counter import MsgCounterHandler from web.models import StudySubject, Study, Visit, Appointment, AppointmentType, Location, AppointmentTypeLink, Subject, User, Worker, Provenance from web.models.constants import GLOBAL_STUDY_ID @@ -98,7 +98,7 @@ class TnsCsvVisitImportReader: old_value = getattr(visit, field) if old_value == new_value: continue - description = u'{} changed from "{}" to "{}"'.format(field, old_value, new_value) + description = '{} changed from "{}" to "{}"'.format(field, old_value, new_value) p = Provenance(modified_table=Visit._meta.db_table, modified_table_id=visit.id, modification_author=self.importer_user, @@ -120,7 +120,7 @@ class TnsCsvVisitImportReader: if field.get_internal_type() == "CharField" or field.get_internal_type() == "DateField" or field.get_internal_type() is "BooleanField": new_value = getattr(visit, field.name) if new_value is not None and new_value != "": - description = u'{} changed from "{}" to "{}"'.format(field, '', new_value) + description = '{} changed from "{}" to "{}"'.format(field, '', new_value) p = Provenance(modified_table=Visit._meta.db_table, modified_table_id=visit.id, modification_author=self.importer_user, @@ -147,7 +147,7 @@ class TnsCsvVisitImportReader: old_value = getattr(appointment, field) if old_value == new_value: continue - description = u'{} changed from "{}" to "{}"'.format(field, old_value, new_value) + description = '{} changed from "{}" to "{}"'.format(field, old_value, new_value) p = Provenance(modified_table=Appointment._meta.db_table, modified_table_id=appointment.id, modification_author=self.importer_user, @@ -172,7 +172,7 @@ class TnsCsvVisitImportReader: if field.get_internal_type() == "CharField" or field.get_internal_type() == "DateField" or field.get_internal_type() is "BooleanField": new_value = getattr(appointment, field.name) if new_value is not None and new_value != "": - description = u'{} changed from "{}" to "{}"'.format(field, '', new_value) + description = '{} changed from "{}" to "{}"'.format(field, '', new_value) p = Provenance(modified_table=Appointment._meta.db_table, modified_table_id=appointment.id, modification_author=self.importer_user, diff --git a/smash/web/importer/exporter.py b/smash/web/importer/exporter.py index 6c44efbc7b3478f22f9e89830b88dcf010cf50ee..d03506547b5ebe97a5cdbf060418f1ea1f2c4fe4 100644 --- a/smash/web/importer/exporter.py +++ b/smash/web/importer/exporter.py @@ -4,7 +4,7 @@ import logging import sys import traceback -from warning_counter import MsgCounterHandler +from .warning_counter import MsgCounterHandler from web.models import StudySubject, Appointment logger = logging.getLogger(__name__) @@ -26,7 +26,7 @@ class SubjectExporter(object): with open(self.filename, 'w') as csv_file: data = self.get_subjects_as_array() - writer = csv.writer(csv_file, quotechar=str(u'"')) + writer = csv.writer(csv_file, quotechar=str('"')) for row in data: writer.writerow([s.encode("utf-8") for s in row]) self.exported_count += 1 @@ -68,7 +68,7 @@ class VisitExporter(object): with open(self.filename, 'w') as csv_file: data = self.get_appointments_as_array() - writer = csv.writer(csv_file, quotechar=str(u'"')) + writer = csv.writer(csv_file, quotechar=str('"')) for row in data: writer.writerow([s.encode("utf-8") for s in row]) self.exported_count += 1 diff --git a/smash/web/importer/exporter_cron_job.py b/smash/web/importer/exporter_cron_job.py index 6491077e57dbf4b7b371f7dba78787c04e3a34f5..4af44d80a508c1b5678d0f578020f2e67fcf85d0 100644 --- a/smash/web/importer/exporter_cron_job.py +++ b/smash/web/importer/exporter_cron_job.py @@ -6,7 +6,7 @@ import timeout_decorator from django.conf import settings from django_cron import CronJobBase, Schedule -from exporter import SubjectExporter, VisitExporter +from .exporter import SubjectExporter, VisitExporter from web.models.constants import CRON_JOB_TIMEOUT from ..smash_email import EmailSender diff --git a/smash/web/importer/importer.py b/smash/web/importer/importer.py index 09ab2ed81251a53bad59b4ea4aec54cbc2b22969..85655e26867d66f9c7d166c83d18b4d4c79c9523 100644 --- a/smash/web/importer/importer.py +++ b/smash/web/importer/importer.py @@ -6,10 +6,11 @@ import traceback from django.conf import settings from django.contrib.auth.models import User -from subject_import_reader import SubjectImportReader -from warning_counter import MsgCounterHandler +from .subject_import_reader import SubjectImportReader +from .warning_counter import MsgCounterHandler from web.models import StudySubject, Subject, Provenance, Worker from web.models.constants import GLOBAL_STUDY_ID +import importlib logger = logging.getLogger(__name__) @@ -34,7 +35,7 @@ class Importer(object): logger.warn("User does not exist: " + importer_user_name) else: self.importer_user = Worker.objects.filter(user=user) - reload(sys) + importlib.reload(sys) sys.setdefaultencoding('utf8') @@ -78,7 +79,7 @@ class Importer(object): new_value = getattr(study_subject.subject, field.name) if new_value is not None and new_value != "": old_value = getattr(db_study_subject.subject, field.name) - description = u'{} changed from "{}" to "{}"'.format(field, old_value, new_value) + description = '{} changed from "{}" to "{}"'.format(field, old_value, new_value) p = Provenance(modified_table=Subject._meta.db_table, modified_table_id=db_study_subject.subject.id, modification_author=self.importer_user, @@ -97,7 +98,7 @@ class Importer(object): new_value = getattr(study_subject, field.name) if new_value is not None and new_value != "": old_value = getattr(db_study_subject, field.name) - description = u'{} changed from "{}" to "{}"'.format(field, old_value, new_value) + description = '{} changed from "{}" to "{}"'.format(field, old_value, new_value) p = Provenance(modified_table=Subject._meta.db_table, modified_table_id=db_study_subject.id, modification_author=self.importer_user, @@ -119,7 +120,7 @@ class Importer(object): if field.get_internal_type() == "CharField" or field.get_internal_type() == "DateField" or field.get_internal_type() is "BooleanField": new_value = getattr(study_subject.subject, field.name) if new_value is not None and new_value != "": - description = u'{} changed from "{}" to "{}"'.format(field, '', new_value) + description = '{} changed from "{}" to "{}"'.format(field, '', new_value) p = Provenance(modified_table=Subject._meta.db_table, modified_table_id=study_subject.subject.id, modification_author=self.importer_user, @@ -134,7 +135,7 @@ class Importer(object): if field.get_internal_type() == "CharField" or field.get_internal_type() == "DateField" or field.get_internal_type() is "BooleanField": new_value = getattr(study_subject, field.name) if new_value is not None and new_value != "": - description = u'{} changed from "{}" to "{}"'.format(field, '', new_value) + description = '{} changed from "{}" to "{}"'.format(field, '', new_value) p = Provenance(modified_table=Subject._meta.db_table, modified_table_id=study_subject.id, modification_author=self.importer_user, diff --git a/smash/web/importer/importer_cron_job.py b/smash/web/importer/importer_cron_job.py index ed4f2ae244805259a3a123e47467c80d0374556a..db4a2da3788785258bcd2b70c372af309c1d4988 100644 --- a/smash/web/importer/importer_cron_job.py +++ b/smash/web/importer/importer_cron_job.py @@ -9,9 +9,9 @@ import timeout_decorator from django.conf import settings from django_cron import CronJobBase, Schedule -from csv_tns_subject_import_reader import TnsCsvSubjectImportReader -from csv_tns_visit_import_reader import TnsCsvVisitImportReader -from importer import Importer +from .csv_tns_subject_import_reader import TnsCsvSubjectImportReader +from .csv_tns_visit_import_reader import TnsCsvVisitImportReader +from .importer import Importer from web.models.constants import CRON_JOB_TIMEOUT from ..smash_email import EmailSender diff --git a/smash/web/migrations/0001_initial.py b/smash/web/migrations/0001_initial.py index 233795f84d355c0c180e6b08aa21117b92feb729..03eecd51456b2d21104465558f53285bca9f9355 100644 --- a/smash/web/migrations/0001_initial.py +++ b/smash/web/migrations/0001_initial.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-01 12:35 -from __future__ import unicode_literals + from django.conf import settings from django.db import migrations, models diff --git a/smash/web/migrations/0002_auto_20170201_1624.py b/smash/web/migrations/0002_auto_20170201_1624.py index 9714bb0bfa91729041f4908c6d7b6a3e7e2bd9db..88cfff229f6220bf8bc618241240837dbc8287da 100644 --- a/smash/web/migrations/0002_auto_20170201_1624.py +++ b/smash/web/migrations/0002_auto_20170201_1624.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-01 16:24 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0003_auto_20170206_1249.py b/smash/web/migrations/0003_auto_20170206_1249.py index 2ab5046152a0a3492dac86a172bd8dd2c2d1d115..ed6dd6b49f031f8e5bb03a988caa441cbad0fe7e 100644 --- a/smash/web/migrations/0003_auto_20170206_1249.py +++ b/smash/web/migrations/0003_auto_20170206_1249.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-06 12:49 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0004_auto_20170207_1400.py b/smash/web/migrations/0004_auto_20170207_1400.py index af740976df21919be287ba5eb7ff8e0f9be9852b..52714d63a34e25a908cc85fa3a13a9b9d8ed195b 100644 --- a/smash/web/migrations/0004_auto_20170207_1400.py +++ b/smash/web/migrations/0004_auto_20170207_1400.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-07 14:00 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0005_auto_20170207_1432.py b/smash/web/migrations/0005_auto_20170207_1432.py index fc68b17b6c441c21375b93959af8e1238ca2c355..de1e7825df18a2e228c47ba2118013c7e428beb6 100644 --- a/smash/web/migrations/0005_auto_20170207_1432.py +++ b/smash/web/migrations/0005_auto_20170207_1432.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-07 14:32 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0006_auto_20170207_1436.py b/smash/web/migrations/0006_auto_20170207_1436.py index 4d5b59df950cedc213551787795dc7609cf9acb3..ddd3bf4859e2d418a02883adce354f45ad6dd458 100644 --- a/smash/web/migrations/0006_auto_20170207_1436.py +++ b/smash/web/migrations/0006_auto_20170207_1436.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-07 14:36 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0007_auto_20170207_1537.py b/smash/web/migrations/0007_auto_20170207_1537.py index 1ce99ab83f27929db45e48dfb40cc0ace83acdfc..1e794e015286acadfa721b472385832263bae9bd 100644 --- a/smash/web/migrations/0007_auto_20170207_1537.py +++ b/smash/web/migrations/0007_auto_20170207_1537.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-07 15:37 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0008_auto_20170207_1604.py b/smash/web/migrations/0008_auto_20170207_1604.py index b875536bb3c0805333d8ef9316dbf6c3bbec3ede..1f9f4cbe2778c858f5ce3de55a38d34f93f1c23f 100644 --- a/smash/web/migrations/0008_auto_20170207_1604.py +++ b/smash/web/migrations/0008_auto_20170207_1604.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-07 16:04 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0009_remove_subject_visit_count.py b/smash/web/migrations/0009_remove_subject_visit_count.py index 837460ea762d6e09a5b22b88b984c303b036f280..360e28dca758d84e6e278aebfbdb0a9a72015a68 100644 --- a/smash/web/migrations/0009_remove_subject_visit_count.py +++ b/smash/web/migrations/0009_remove_subject_visit_count.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-08 10:26 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0010_remove_subject_main_pseudonym.py b/smash/web/migrations/0010_remove_subject_main_pseudonym.py index 13f268580abe41c24e3926d55122c322dd187e58..fe9c93f86f2857ea7066e6477417d73ab5a8f524 100644 --- a/smash/web/migrations/0010_remove_subject_main_pseudonym.py +++ b/smash/web/migrations/0010_remove_subject_main_pseudonym.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-08 11:55 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0011_auto_20170208_1208.py b/smash/web/migrations/0011_auto_20170208_1208.py index 7f4ddaba0ba7ac9cbb4124db72cdbf5fb227a0c0..673363bb0a13c59a0eb4881ebd42778373a66f0d 100644 --- a/smash/web/migrations/0011_auto_20170208_1208.py +++ b/smash/web/migrations/0011_auto_20170208_1208.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-08 12:08 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0012_auto_20170208_1414.py b/smash/web/migrations/0012_auto_20170208_1414.py index d32f6c72323b0e95a8d43c1cff3be947fe95233a..3d6e9acb27b528339c72c0fd5618524aa9001222 100644 --- a/smash/web/migrations/0012_auto_20170208_1414.py +++ b/smash/web/migrations/0012_auto_20170208_1414.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-08 14:14 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0013_auto_20170208_1415.py b/smash/web/migrations/0013_auto_20170208_1415.py index 09da90ca98fceeb485ceae5ef7c4b71d8cacc142..0185b0cb079575b6d92cd1feddb2503a26b030f2 100644 --- a/smash/web/migrations/0013_auto_20170208_1415.py +++ b/smash/web/migrations/0013_auto_20170208_1415.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-08 14:15 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0014_auto_20170220_0812.py b/smash/web/migrations/0014_auto_20170220_0812.py index a0ebef6afe8fd04d4d2140b294815dc4efa1570d..25478fad57fa85a6074d45db72230020a9059848 100644 --- a/smash/web/migrations/0014_auto_20170220_0812.py +++ b/smash/web/migrations/0014_auto_20170220_0812.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-20 08:12 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0015_auto_20170228_1651.py b/smash/web/migrations/0015_auto_20170228_1651.py index a53ee29dc18e1852f98c5b0270e6e4e311fdc762..c3801f510bcd91808ed239a29aa000b3b2fd35a1 100644 --- a/smash/web/migrations/0015_auto_20170228_1651.py +++ b/smash/web/migrations/0015_auto_20170228_1651.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-28 16:51 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0016_auto_20170228_1652.py b/smash/web/migrations/0016_auto_20170228_1652.py index 44d8b8fc8bc629e72026121e7527dd8d07d75222..d7b975af32683fe7803cba84fd63126c55f07d29 100644 --- a/smash/web/migrations/0016_auto_20170228_1652.py +++ b/smash/web/migrations/0016_auto_20170228_1652.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-28 16:52 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0017_auto_20170301_1600.py b/smash/web/migrations/0017_auto_20170301_1600.py index fdafbf088402a0be496db27ffa1f559085e30a62..77814d62961c638605d9d8ed25e06f524e696a1d 100644 --- a/smash/web/migrations/0017_auto_20170301_1600.py +++ b/smash/web/migrations/0017_auto_20170301_1600.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-03-01 16:00 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0018_auto_20170307_1602.py b/smash/web/migrations/0018_auto_20170307_1602.py index 0129a05c53c2b269939784d75bd145380f0811f9..14a6c6cf1f1ae70f09fe7ccbf0a192be67e8e354 100644 --- a/smash/web/migrations/0018_auto_20170307_1602.py +++ b/smash/web/migrations/0018_auto_20170307_1602.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-03-07 16:02 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0019_auto_20170309_1538.py b/smash/web/migrations/0019_auto_20170309_1538.py index 2c3c404e33d61903df3d72219b711a29820a8c69..d50b7e3a2a1d427eb560b2c8077d3adc5a2dd161 100644 --- a/smash/web/migrations/0019_auto_20170309_1538.py +++ b/smash/web/migrations/0019_auto_20170309_1538.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-03-09 15:38 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0020_auto_20170309_1545.py b/smash/web/migrations/0020_auto_20170309_1545.py index 835d12081165048fa244db37f182904f6f2b2f7a..4301f57029d1cd1c9357a5e3f65bed842ac0f7a3 100644 --- a/smash/web/migrations/0020_auto_20170309_1545.py +++ b/smash/web/migrations/0020_auto_20170309_1545.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-03-09 15:45 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0021_auto_20170317_0738.py b/smash/web/migrations/0021_auto_20170317_0738.py index cdc4a01059acab4311b659cd077df09c9cca90bf..57c7a116bdd1c85a1b42a60bb0c9a334dc011b41 100644 --- a/smash/web/migrations/0021_auto_20170317_0738.py +++ b/smash/web/migrations/0021_auto_20170317_0738.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-03-17 07:38 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0022_auto_20170403_0904.py b/smash/web/migrations/0022_auto_20170403_0904.py index cc5107ebc7fbdbba5815ab803bca89f9f7866992..95aee17872f28c119ae8b03ad436f4004ffd68e5 100644 --- a/smash/web/migrations/0022_auto_20170403_0904.py +++ b/smash/web/migrations/0022_auto_20170403_0904.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-03 09:04 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0023_auto_20170404_1047.py b/smash/web/migrations/0023_auto_20170404_1047.py index 48b9fe7b07f12ab506125bb24049ef520d46a354..d62117ae22cbb2ccff9b08488033a768bb117b81 100644 --- a/smash/web/migrations/0023_auto_20170404_1047.py +++ b/smash/web/migrations/0023_auto_20170404_1047.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-04 08:47 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0024_configurationitem.py b/smash/web/migrations/0024_configurationitem.py index ccaf21dc692e80529fdea85edd4191ff591d7108..d71473f90b24bfa489f22c2a826af8d0064b3a82 100644 --- a/smash/web/migrations/0024_configurationitem.py +++ b/smash/web/migrations/0024_configurationitem.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-04 09:43 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0025_configurationitem_calendar_items.py b/smash/web/migrations/0025_configurationitem_calendar_items.py index a5c6a47127bfd6bb95daf65b8e5fb3cd07e92db5..153ac09dc6fb5236be258330a737ed3082a7903a 100644 --- a/smash/web/migrations/0025_configurationitem_calendar_items.py +++ b/smash/web/migrations/0025_configurationitem_calendar_items.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-04 09:43 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0026_location_color.py b/smash/web/migrations/0026_location_color.py index 13ee7979d3cdc27c5ba203ae212ec3ceacbbdc80..675cd0a345428457e6b195f53f194829ef25e6d2 100644 --- a/smash/web/migrations/0026_location_color.py +++ b/smash/web/migrations/0026_location_color.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-04 13:03 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0027_auto_20170404_1505.py b/smash/web/migrations/0027_auto_20170404_1505.py index 01cd2610e01647f7d4d308f4ea4bd5887e4bf1b1..c602732507708070c1b23f84bc4ee5c8de99a94b 100644 --- a/smash/web/migrations/0027_auto_20170404_1505.py +++ b/smash/web/migrations/0027_auto_20170404_1505.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-04 13:05 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0028_location_color_of_flying_team.py b/smash/web/migrations/0028_location_color_of_flying_team.py index 4522720616ab0bf33e492245d9fb9327e5af9bd6..926a033201e29d443a6497fec8f79f6e66503d3d 100644 --- a/smash/web/migrations/0028_location_color_of_flying_team.py +++ b/smash/web/migrations/0028_location_color_of_flying_team.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-04 09:43 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0029_auto_20170404_1616.py b/smash/web/migrations/0029_auto_20170404_1616.py index 1f24145c9d554209b21b3912e58f62d89cee4862..aaa9f0c7dbecc85d026787ac6493a344a83a3d63 100644 --- a/smash/web/migrations/0029_auto_20170404_1616.py +++ b/smash/web/migrations/0029_auto_20170404_1616.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-04 14:16 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0030_subject_information_sent.py b/smash/web/migrations/0030_subject_information_sent.py index ddde585819750b7f56b23195964b7b3874921ac0..6bef7fd371e208a5740a550b79c57f315636aaf8 100644 --- a/smash/web/migrations/0030_subject_information_sent.py +++ b/smash/web/migrations/0030_subject_information_sent.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-04 14:16 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0031_appointment_post_mail_sent.py b/smash/web/migrations/0031_appointment_post_mail_sent.py index aab4ab8702c498349ab6e8630c7cd910445220af..173aa65ef70598333d50930c18494542eb70cf54 100644 --- a/smash/web/migrations/0031_appointment_post_mail_sent.py +++ b/smash/web/migrations/0031_appointment_post_mail_sent.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-05 07:39 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0032_configurationitem_email_items.py b/smash/web/migrations/0032_configurationitem_email_items.py index 1e2142aa414c08d1a33589fd2044a13238b391e2..e85e5f0f472998d9ef324c53ffb243a504f52139 100644 --- a/smash/web/migrations/0032_configurationitem_email_items.py +++ b/smash/web/migrations/0032_configurationitem_email_items.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-04 09:43 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0033_auto_20170406_1146.py b/smash/web/migrations/0033_auto_20170406_1146.py index c12ce67d6f03a61a8018f4f902586710c4b0be5a..c8b6295cdfc814542d0c766fbb55e5e4b98f390d 100644 --- a/smash/web/migrations/0033_auto_20170406_1146.py +++ b/smash/web/migrations/0033_auto_20170406_1146.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-06 09:46 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0034_mail_templates.py b/smash/web/migrations/0034_mail_templates.py index 20dec068d4b2392361b8c76a112dd32828354401..4539c95200a252195284fd9c3cad005e364f6d50 100644 --- a/smash/web/migrations/0034_mail_templates.py +++ b/smash/web/migrations/0034_mail_templates.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-07 07:10 -from __future__ import unicode_literals + import django.db.models.deletion from django.db import migrations, models diff --git a/smash/web/migrations/0035_screening_number.py b/smash/web/migrations/0035_screening_number.py index 3bf1a4e18c22356fc3a472716073dd1e28f72480..cbb55f76b14556a089d213a41ab250b0c6441c7f 100644 --- a/smash/web/migrations/0035_screening_number.py +++ b/smash/web/migrations/0035_screening_number.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-20 14:35 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0036_year_of_diagnosis_default.py b/smash/web/migrations/0036_year_of_diagnosis_default.py index 173f64b200ff28e468d0e26b6b1ce5ebf5271e8a..43d9d2bfa9a6fca0b0b4e1ae1cec4a24c582b87b 100644 --- a/smash/web/migrations/0036_year_of_diagnosis_default.py +++ b/smash/web/migrations/0036_year_of_diagnosis_default.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-25 07:28 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0037_appointment_types_descriptions_changes.py b/smash/web/migrations/0037_appointment_types_descriptions_changes.py index a17f554c73ed4bc9f4854a8e509f4a94a4aefc2b..bf9017155af8b2080ca175ade45f1cf2bb65deb0 100644 --- a/smash/web/migrations/0037_appointment_types_descriptions_changes.py +++ b/smash/web/migrations/0037_appointment_types_descriptions_changes.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-20 14:35 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0038_subject_pd_family_allow_null.py b/smash/web/migrations/0038_subject_pd_family_allow_null.py index cf0d4757d70ea13e5b71b0f74e6e0dc0b514aeff..84a908f2f12e149cf55ec8080681a07c3f2bdea6 100644 --- a/smash/web/migrations/0038_subject_pd_family_allow_null.py +++ b/smash/web/migrations/0038_subject_pd_family_allow_null.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-26 06:58 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0039_pd_family_default_unknown.py b/smash/web/migrations/0039_pd_family_default_unknown.py index dba92d641cd5ae0c3e3684b973ee670b273c6847..7c718a07dde4a5defc9521e5d9c8e40752914cbd 100644 --- a/smash/web/migrations/0039_pd_family_default_unknown.py +++ b/smash/web/migrations/0039_pd_family_default_unknown.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-05-17 13:46 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0040_daily_planning.py b/smash/web/migrations/0040_daily_planning.py index 5e0404df8547fc898e1a4fbb07b8e72a2083d75d..13337273897a613b0c7c2e69bd22894c7f19c46d 100644 --- a/smash/web/migrations/0040_daily_planning.py +++ b/smash/web/migrations/0040_daily_planning.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-05-09 11:49 -from __future__ import unicode_literals + import django.db.models.deletion from django.db import migrations, models diff --git a/smash/web/migrations/0041_language_windows_locale_name.py b/smash/web/migrations/0041_language_windows_locale_name.py index 84a76761f8b7807265d4b1f0ea2ca094374a12ee..44f218ed1535d5a95cce436f568264b06f2500fe 100644 --- a/smash/web/migrations/0041_language_windows_locale_name.py +++ b/smash/web/migrations/0041_language_windows_locale_name.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-06-13 14:34 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0042_auto_20170613_1634.py b/smash/web/migrations/0042_auto_20170613_1634.py index dee0307d38b35002a40c9fb68645d2efee35b454..b338e9185339a0214e5391a39a722292498cac99 100644 --- a/smash/web/migrations/0042_auto_20170613_1634.py +++ b/smash/web/migrations/0042_auto_20170613_1634.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-06-13 14:34 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0043_auto_20170904_1240.py b/smash/web/migrations/0043_auto_20170904_1240.py index d3e36a76b842b5102a1fd59c8782d64b873ad530..048ce09bfccb17beb20720a2efc022de3411350a 100644 --- a/smash/web/migrations/0043_auto_20170904_1240.py +++ b/smash/web/migrations/0043_auto_20170904_1240.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-09-04 10:40 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0044_auto_20170904_1602.py b/smash/web/migrations/0044_auto_20170904_1602.py index 204314cb090d496ae0185b5509487534a84f0983..8f020d02de60b99bb4737165b85f8e10d8982f7f 100644 --- a/smash/web/migrations/0044_auto_20170904_1602.py +++ b/smash/web/migrations/0044_auto_20170904_1602.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-09-04 14:02 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0045_holiday_info.py b/smash/web/migrations/0045_holiday_info.py index 37ab292b75130fbaa95ceaac2afb68f76fc6de5b..523998c286b6c95355268646d032204e2d350a88 100644 --- a/smash/web/migrations/0045_holiday_info.py +++ b/smash/web/migrations/0045_holiday_info.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-09-04 15:09 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0046_subject_flying_team.py b/smash/web/migrations/0046_subject_flying_team.py index 3101c686d80256eb03b7d5e27e76f30ea5f65ff7..c8ba8a8e9cf3148d27dcab87293b91f1bf127cd4 100644 --- a/smash/web/migrations/0046_subject_flying_team.py +++ b/smash/web/migrations/0046_subject_flying_team.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-09-11 10:07 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0047_subject_flying_team_from_annotation.py b/smash/web/migrations/0047_subject_flying_team_from_annotation.py index 7b514e537ecdda24e2882e9a6b1557abf317a375..375fcb896572c7c5ff0fac648200856b65c5b495 100644 --- a/smash/web/migrations/0047_subject_flying_team_from_annotation.py +++ b/smash/web/migrations/0047_subject_flying_team_from_annotation.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # assigns default flying team location for subjects that had in the past finished appointment at flying team location -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0048_auto_20170911_1504.py b/smash/web/migrations/0048_auto_20170911_1504.py index 4c627d657a40fbabad6e031d701b2cfc9f317eab..34fcc07d0232574ecf11e5dffdf926196cacd67e 100644 --- a/smash/web/migrations/0048_auto_20170911_1504.py +++ b/smash/web/migrations/0048_auto_20170911_1504.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-09-11 13:04 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0049_auto_20170912_1438.py b/smash/web/migrations/0049_auto_20170912_1438.py index bcca9e64b11c01fc021e79300bf4abb53e8c4f82..f6c8c021383267d0e8c9f3c9843c3ada478a8971 100644 --- a/smash/web/migrations/0049_auto_20170912_1438.py +++ b/smash/web/migrations/0049_auto_20170912_1438.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-09-12 12:38 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0050_configurationitem_redcap_items.py b/smash/web/migrations/0050_configurationitem_redcap_items.py index b7befcc120fd24a81201e66894516270be98781c..a615fc1963e3bee12ce503f9551b4e5fbd15c32e 100644 --- a/smash/web/migrations/0050_configurationitem_redcap_items.py +++ b/smash/web/migrations/0050_configurationitem_redcap_items.py @@ -1,4 +1,4 @@ -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0051_missingsubject.py b/smash/web/migrations/0051_missingsubject.py index ee2ac92ab67ef1aa342af2db28daf5759b5e5ea1..1d443d1ec3392fe3de6709f640219124b1d55c3a 100644 --- a/smash/web/migrations/0051_missingsubject.py +++ b/smash/web/migrations/0051_missingsubject.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-09-12 14:54 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0052_auto_20170913_0943.py b/smash/web/migrations/0052_auto_20170913_0943.py index 851f4cccb60f063d88f3e5cf8bda22d63a8fee63..0d15c41794e1f5ddc83937f152f91f800f4f666b 100644 --- a/smash/web/migrations/0052_auto_20170913_0943.py +++ b/smash/web/migrations/0052_auto_20170913_0943.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-09-13 07:43 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0053_auto_20170913_0948.py b/smash/web/migrations/0053_auto_20170913_0948.py index 83284054ea9e7aaa6df6c66e389e86e107d3e3aa..710e47e5325a5d9ab8d224dbd9cc62ce963b0f0a 100644 --- a/smash/web/migrations/0053_auto_20170913_0948.py +++ b/smash/web/migrations/0053_auto_20170913_0948.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-09-13 07:48 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0054_remove_inconsistentsubject_ignore.py b/smash/web/migrations/0054_remove_inconsistentsubject_ignore.py index e0e4de83c12b6aedd6a67419e3413d7206aa5a16..6ce2b61459e5e6c2784402a200cf7919f37512f0 100644 --- a/smash/web/migrations/0054_remove_inconsistentsubject_ignore.py +++ b/smash/web/migrations/0054_remove_inconsistentsubject_ignore.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-09-13 15:33 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0055_auto_20170925_0905.py b/smash/web/migrations/0055_auto_20170925_0905.py index 1263dd7c14e56c2f6d7341d69ff2445e0ee3c16f..c2859add2d03b808e960ea8ad1f9e0b87f1b534b 100644 --- a/smash/web/migrations/0055_auto_20170925_0905.py +++ b/smash/web/migrations/0055_auto_20170925_0905.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-09-25 09:05 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0056_visit_visit_number.py b/smash/web/migrations/0056_visit_visit_number.py index 3be1cb193f27909dfbb70c8cddbd9156540ba146..4317c86bdc4868eec564911ccbbf5603ffe2fb20 100644 --- a/smash/web/migrations/0056_visit_visit_number.py +++ b/smash/web/migrations/0056_visit_visit_number.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-10-27 10:22 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0057_update_visit_number_for_existing_visits.py b/smash/web/migrations/0057_update_visit_number_for_existing_visits.py index 6697af45d131464e03ef50b75f4a4820dff48143..53f8c82d2e440dbe96a539d6b8cba6b4ebbf51a5 100644 --- a/smash/web/migrations/0057_update_visit_number_for_existing_visits.py +++ b/smash/web/migrations/0057_update_visit_number_for_existing_visits.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-10-27 10:22 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0058_country.py b/smash/web/migrations/0058_country.py index e1f51c42295c51137e0ed14c3726e1811cd3546c..a00887fb964764f61be924e6b7e4c9aa71390a6b 100644 --- a/smash/web/migrations/0058_country.py +++ b/smash/web/migrations/0058_country.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-10-31 08:02 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0059_subject_country_2.py b/smash/web/migrations/0059_subject_country_2.py index 9c48092005d9db60f437c64b5c2ada3544cb6ed1..9b0e2190b1e2f30b8abf6ad2d5c30747ac0c0a8c 100644 --- a/smash/web/migrations/0059_subject_country_2.py +++ b/smash/web/migrations/0059_subject_country_2.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-10-31 08:36 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0060_remove_subject_country.py b/smash/web/migrations/0060_remove_subject_country.py index 43603845117ded69fa8c64998f469734bcc3c119..872629057b5410ee6363382cbc1490641fc5a49c 100644 --- a/smash/web/migrations/0060_remove_subject_country.py +++ b/smash/web/migrations/0060_remove_subject_country.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-10-31 09:15 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0061_remove_subject_country.py b/smash/web/migrations/0061_remove_subject_country.py index 526e2ec7f457107449172dc77ecc9b4e84289630..23befcb7da96d986fa8af72ff7ca205a1974eab2 100644 --- a/smash/web/migrations/0061_remove_subject_country.py +++ b/smash/web/migrations/0061_remove_subject_country.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-10-31 09:15 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0062_subject_resign_reason.py b/smash/web/migrations/0062_subject_resign_reason.py index cb3ba4eb4443605f591c9a44ff5e36256513da19..92635ff084cf32dbc0a1165a8f17126906dabcf5 100644 --- a/smash/web/migrations/0062_subject_resign_reason.py +++ b/smash/web/migrations/0062_subject_resign_reason.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-10-31 12:14 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0063_auto_20171120_1429.py b/smash/web/migrations/0063_auto_20171120_1429.py index 7b9c1de9d8c4e5eba269740c479e658a87de8433..7f3ba2473cfc9615285c90038a5cc78e68081710 100644 --- a/smash/web/migrations/0063_auto_20171120_1429.py +++ b/smash/web/migrations/0063_auto_20171120_1429.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-11-20 14:29 -from __future__ import unicode_literals + import django.core.validators from django.db import migrations, models diff --git a/smash/web/migrations/0064_auto_20171127_0954.py b/smash/web/migrations/0064_auto_20171127_0954.py index 4fd29798f2f5fa6180904177aa22be5db2c72dcc..7d1c5b63869274619de2565c1ccaf850a832a194 100644 --- a/smash/web/migrations/0064_auto_20171127_0954.py +++ b/smash/web/migrations/0064_auto_20171127_0954.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-11-27 09:54 -from __future__ import unicode_literals + import django.core.validators from django.db import migrations, models diff --git a/smash/web/migrations/0065_auto_20171127_0957.py b/smash/web/migrations/0065_auto_20171127_0957.py index 79e6a2a186804e87b40fb729b72c03247b6561ea..28713af2bda156ad00306eb7e2737f1c5ab13b1e 100644 --- a/smash/web/migrations/0065_auto_20171127_0957.py +++ b/smash/web/migrations/0065_auto_20171127_0957.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-11-27 09:57 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0066_subject.py b/smash/web/migrations/0066_subject.py index b57fe844d05485e60d6c77ea66aa021e3a65c587..3b3fa93766dc8fa7f7e4879e40a31903c61f7f73 100644 --- a/smash/web/migrations/0066_subject.py +++ b/smash/web/migrations/0066_subject.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-11-27 10:42 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0067_subject.py b/smash/web/migrations/0067_subject.py index 1d6b45e6679e20d3e3a481b1e6be46f460f877ad..42d8161b890631c54629120b78c11f49ea4a71ad 100644 --- a/smash/web/migrations/0067_subject.py +++ b/smash/web/migrations/0067_subject.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-11-27 13:29 -from __future__ import unicode_literals + import django.db.models.deletion from django.db import migrations, models diff --git a/smash/web/migrations/0068_remove_studysubject_dead.py b/smash/web/migrations/0068_remove_studysubject_dead.py index 75f6b95408308d0413cff30232afe1947145333e..5d845277c68a4696ad36665d4d0178da1a63ebe6 100644 --- a/smash/web/migrations/0068_remove_studysubject_dead.py +++ b/smash/web/migrations/0068_remove_studysubject_dead.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-11-27 15:29 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0069_remove_studysubject_sex.py b/smash/web/migrations/0069_remove_studysubject_sex.py index 1f3c708b0a2e3d52db8ff7cf14d7bcad70fe1e5c..0851a091a9e359b55185ac6aed82c7780bf9fe69 100644 --- a/smash/web/migrations/0069_remove_studysubject_sex.py +++ b/smash/web/migrations/0069_remove_studysubject_sex.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-11-28 11:14 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0070_auto_20171128_1124.py b/smash/web/migrations/0070_auto_20171128_1124.py index fe02c8a9cedff7df383393b69fcbd63178b9185c..90c9d7e38ab19bba6cc9082b065c112a3bed4161 100644 --- a/smash/web/migrations/0070_auto_20171128_1124.py +++ b/smash/web/migrations/0070_auto_20171128_1124.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-11-28 11:24 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0071_auto_20171130_1607.py b/smash/web/migrations/0071_auto_20171130_1607.py index c757fdc14f19e05e1dc95a1518757140e59179db..6915cb1026bd06500012b53b2b31302c77d20854 100644 --- a/smash/web/migrations/0071_auto_20171130_1607.py +++ b/smash/web/migrations/0071_auto_20171130_1607.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-11-30 16:07 -from __future__ import unicode_literals + import django.db.models.deletion from django.db import migrations, models diff --git a/smash/web/migrations/0072_auto_20171201_1013.py b/smash/web/migrations/0072_auto_20171201_1013.py index c90da294dd1ceb61ac58b09bbdc8b1eff9588641..2067c07ef08d2b7a4eef85bbdff21ba0efbc9c8d 100644 --- a/smash/web/migrations/0072_auto_20171201_1013.py +++ b/smash/web/migrations/0072_auto_20171201_1013.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-01 10:13 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0073_auto_20171201_1034.py b/smash/web/migrations/0073_auto_20171201_1034.py index d23196db8c602c9824645a587468ef700dc7587d..dc18022247801fe5a4214c67c784fa7e4729cd14 100644 --- a/smash/web/migrations/0073_auto_20171201_1034.py +++ b/smash/web/migrations/0073_auto_20171201_1034.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-01 10:34 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0074_auto_20171201_1038.py b/smash/web/migrations/0074_auto_20171201_1038.py index 55297a5b043aec9a5285464223c44444586d3edc..5705718368ed9bf1c0c274589a007b04e79ba466 100644 --- a/smash/web/migrations/0074_auto_20171201_1038.py +++ b/smash/web/migrations/0074_auto_20171201_1038.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-01 10:38 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0075_auto_20171201_1252.py b/smash/web/migrations/0075_auto_20171201_1252.py index 5d11beaa9167f3e0cd36d8688c1c2243e4a95d6c..ccc941c0e8aea164947e5d465b0c0936947d9473 100644 --- a/smash/web/migrations/0075_auto_20171201_1252.py +++ b/smash/web/migrations/0075_auto_20171201_1252.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-01 12:52 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0076_studysubjectlist.py b/smash/web/migrations/0076_studysubjectlist.py index 1da548038649494fb446aa0104f29a5bea51de9f..f812c31979b1b986217c9518eae1b928d7a53bfd 100644 --- a/smash/web/migrations/0076_studysubjectlist.py +++ b/smash/web/migrations/0076_studysubjectlist.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-01 14:51 -from __future__ import unicode_literals + import django.db.models.deletion from django.db import migrations, models diff --git a/smash/web/migrations/0077_subjectcolumns.py b/smash/web/migrations/0077_subjectcolumns.py index 1f2757b04f8c8c6779b880e96fbacf37d94ec5af..304dfe796e2fb420850048bec339b7b517ea4e32 100644 --- a/smash/web/migrations/0077_subjectcolumns.py +++ b/smash/web/migrations/0077_subjectcolumns.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-01 15:21 -from __future__ import unicode_literals + import django from django.db import migrations, models diff --git a/smash/web/migrations/0078_auto_20171204_1040.py b/smash/web/migrations/0078_auto_20171204_1040.py index 06dc369996b24803baa93bb6fdea4f795f0329ef..a7553622679b67bd8962cb0050f95f647a1f0eca 100644 --- a/smash/web/migrations/0078_auto_20171204_1040.py +++ b/smash/web/migrations/0078_auto_20171204_1040.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-04 10:40 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0079_auto_20171204_1235.py b/smash/web/migrations/0079_auto_20171204_1235.py index b81fd3f647eeadee94cd778a83e2d07ed004aeff..a02da51ce887069f0345e29669ed5c10509d26f5 100644 --- a/smash/web/migrations/0079_auto_20171204_1235.py +++ b/smash/web/migrations/0079_auto_20171204_1235.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-04 12:35 -from __future__ import unicode_literals + import django.db.models.deletion from django.db import migrations, models diff --git a/smash/web/migrations/0080_auto_20171204_1341.py b/smash/web/migrations/0080_auto_20171204_1341.py index e513330345951900260658d4cd4940c0005d2bed..6988fe552f44ce3073f7107fe70efc6f4790becb 100644 --- a/smash/web/migrations/0080_auto_20171204_1341.py +++ b/smash/web/migrations/0080_auto_20171204_1341.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-04 13:41 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0081_studysubjectlist_last_contact_attempt.py b/smash/web/migrations/0081_studysubjectlist_last_contact_attempt.py index f08fc38f8c309472850c83f755bc79c5ed3742dd..da4c5e8bc3542e32a76b55564122df2be82a19d9 100644 --- a/smash/web/migrations/0081_studysubjectlist_last_contact_attempt.py +++ b/smash/web/migrations/0081_studysubjectlist_last_contact_attempt.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-04 14:31 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0082_studysubjectlist_visits.py b/smash/web/migrations/0082_studysubjectlist_visits.py index a14a9f01e6749a562a5d3d03802c23e9d80741da..8cd76414555b44dafcea9039e60ae5eb38c88cf8 100644 --- a/smash/web/migrations/0082_studysubjectlist_visits.py +++ b/smash/web/migrations/0082_studysubjectlist_visits.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-04 16:47 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0083_auto_20171205_1251.py b/smash/web/migrations/0083_auto_20171205_1251.py index cce682bd38f6119785b96ce29c81d5ecc1abed1f..051d9c7197f151c4514ad3c23089c94e2e82d769 100644 --- a/smash/web/migrations/0083_auto_20171205_1251.py +++ b/smash/web/migrations/0083_auto_20171205_1251.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-05 12:51 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0084_auto_20171205_1640.py b/smash/web/migrations/0084_auto_20171205_1640.py index 10e2c9e1b343cab292e032586bb25a0f6e11796c..9a23ca67535e5cf3fbe8228ced13be599729b376 100644 --- a/smash/web/migrations/0084_auto_20171205_1640.py +++ b/smash/web/migrations/0084_auto_20171205_1640.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-05 16:40 -from __future__ import unicode_literals + import django.db.models.deletion from django.db import migrations, models diff --git a/smash/web/migrations/0085_auto_20171205_1650.py b/smash/web/migrations/0085_auto_20171205_1650.py index 2ffcafec5c7f58f48eafb8b20dd9c61fa809d1cd..a579ab205678ed0b02b8a101afa6b064202d09ee 100644 --- a/smash/web/migrations/0085_auto_20171205_1650.py +++ b/smash/web/migrations/0085_auto_20171205_1650.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-05 16:50 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0086_unfinished_visit_list.py b/smash/web/migrations/0086_unfinished_visit_list.py index 9b8f79975a0b56335cc1b52f1e391cb1dce7938c..30a4f25b4c72eb282858df251a24d3bea91f8925 100644 --- a/smash/web/migrations/0086_unfinished_visit_list.py +++ b/smash/web/migrations/0086_unfinished_visit_list.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-05 16:50 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0087_approaching_visit_wihout_appointment_list.py b/smash/web/migrations/0087_approaching_visit_wihout_appointment_list.py index 882bd663024189c2f754e7b241d6f88583d67a4b..5ea8c79fcf489be83b49a5728111f31f8d0e519b 100644 --- a/smash/web/migrations/0087_approaching_visit_wihout_appointment_list.py +++ b/smash/web/migrations/0087_approaching_visit_wihout_appointment_list.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-05 16:50 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0088_appointmentcolumns_appointmentlist.py b/smash/web/migrations/0088_appointmentcolumns_appointmentlist.py index 3473fdc6d0f2a643a4bfe2f4e22c8c3e089bfe85..129299f9a96f4cc3e8207689699f477a3b777f44 100644 --- a/smash/web/migrations/0088_appointmentcolumns_appointmentlist.py +++ b/smash/web/migrations/0088_appointmentcolumns_appointmentlist.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-07 13:07 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0089_unfinshed_appointment_list.py b/smash/web/migrations/0089_unfinshed_appointment_list.py index dabf6f9fa77d3e3451c41225cb9dfaf64df310a5..95a60d3a3a5051bb67bd316a3e3b0fcdc97a2e78 100644 --- a/smash/web/migrations/0089_unfinshed_appointment_list.py +++ b/smash/web/migrations/0089_unfinshed_appointment_list.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-05 16:50 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0090_vouchertype_vouchertypeprice.py b/smash/web/migrations/0090_vouchertype_vouchertypeprice.py index 8697161bd2ad70161c47fef53cac172c60e8fb34..6b76896e3f154746b813e1182720aa334f689073 100644 --- a/smash/web/migrations/0090_vouchertype_vouchertypeprice.py +++ b/smash/web/migrations/0090_vouchertype_vouchertypeprice.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-08 09:00 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0091_auto_20171208_1312.py b/smash/web/migrations/0091_auto_20171208_1312.py index 3c823e288d5e639c074ca55b08041f45aa18d1c7..153b13119e802da6686850138fac162534836530 100644 --- a/smash/web/migrations/0091_auto_20171208_1312.py +++ b/smash/web/migrations/0091_auto_20171208_1312.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-08 13:12 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0092_voucher.py b/smash/web/migrations/0092_voucher.py index 963120ee80b966459eebaf0c9490d56b9ca37a85..27cc0e2e16cfbcf3b1daabcb3d22b04fd322229c 100644 --- a/smash/web/migrations/0092_voucher.py +++ b/smash/web/migrations/0092_voucher.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-08 15:00 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0093_auto_20171208_1508.py b/smash/web/migrations/0093_auto_20171208_1508.py index 839c2936a2f41311e6f79358abe979c4abe41b83..5a6caa2019cbe5624a632edf2732e11120b94e46 100644 --- a/smash/web/migrations/0093_auto_20171208_1508.py +++ b/smash/web/migrations/0093_auto_20171208_1508.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-08 15:08 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0094_auto_20171208_1508.py b/smash/web/migrations/0094_auto_20171208_1508.py index 5ca263649479e21e768968f07d8db7ba7d3d65ee..ecec765cddd3e9015c5e052dda523400c90062a0 100644 --- a/smash/web/migrations/0094_auto_20171208_1508.py +++ b/smash/web/migrations/0094_auto_20171208_1508.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-08 15:08 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0095_auto_20171208_1509.py b/smash/web/migrations/0095_auto_20171208_1509.py index 37b50905594f0b4d2e34c07991813bb36b5fe7a9..7706528368ce05b9a6308f706ffedfd8e378394d 100644 --- a/smash/web/migrations/0095_auto_20171208_1509.py +++ b/smash/web/migrations/0095_auto_20171208_1509.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-08 15:09 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0096_auto_20171208_1509.py b/smash/web/migrations/0096_auto_20171208_1509.py index b076d5c3f0bcb912bab2db36a94f67bc15746c85..a23e3ce370719e7124ef3d8d2d976b86bcfd763e 100644 --- a/smash/web/migrations/0096_auto_20171208_1509.py +++ b/smash/web/migrations/0096_auto_20171208_1509.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-08 15:09 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0097_auto_20171211_1616.py b/smash/web/migrations/0097_auto_20171211_1616.py index 676c94f20f7f1553d4cc15445331f6b18548b849..852359a8c7ae673043b269287a891513f07acccb 100644 --- a/smash/web/migrations/0097_auto_20171211_1616.py +++ b/smash/web/migrations/0097_auto_20171211_1616.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-11 16:16 -from __future__ import unicode_literals + import django.core.files.storage from django.db import migrations, models diff --git a/smash/web/migrations/0098_workerstudyrole.py b/smash/web/migrations/0098_workerstudyrole.py index 247c4ad401d6407649a19c6b4936f5ed3f4d210c..1a205daeca67eaae6cafb6a65b0d5a6641298757 100644 --- a/smash/web/migrations/0098_workerstudyrole.py +++ b/smash/web/migrations/0098_workerstudyrole.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-12 14:15 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0099_auto_20171213_1115.py b/smash/web/migrations/0099_auto_20171213_1115.py index 36f7df053335eaaf12b53d29195e6160dcc2d171..63b737a52b85276505f847e8659f48b78d72d916 100644 --- a/smash/web/migrations/0099_auto_20171213_1115.py +++ b/smash/web/migrations/0099_auto_20171213_1115.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-13 11:15 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0100_auto_20171213_1140.py b/smash/web/migrations/0100_auto_20171213_1140.py index 6bacef3d9db5c8a66ca87363c89cf0c37ffc13a1..85a67f9fe0dc3249ed870d6e296d5fc1a75e84da 100644 --- a/smash/web/migrations/0100_auto_20171213_1140.py +++ b/smash/web/migrations/0100_auto_20171213_1140.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-13 11:40 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0101_auto_20171214_1047.py b/smash/web/migrations/0101_auto_20171214_1047.py index 26e3d5740cd5870018d7613e684fe46c0f8fdc61..530b92c8fd3ecbb946c6a6bfabd4041d09b8baf0 100644 --- a/smash/web/migrations/0101_auto_20171214_1047.py +++ b/smash/web/migrations/0101_auto_20171214_1047.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-14 10:47 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0102_studynotificationparameters_subject_voucher_expiry_visible.py b/smash/web/migrations/0102_studynotificationparameters_subject_voucher_expiry_visible.py index df7f4833a1e947d2240708c52e8229396ffc09d3..1c7c1b1bfb7b6f575ae2ec365e9fe1b9dd06a6a4 100644 --- a/smash/web/migrations/0102_studynotificationparameters_subject_voucher_expiry_visible.py +++ b/smash/web/migrations/0102_studynotificationparameters_subject_voucher_expiry_visible.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-12-14 12:55 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0103_auto_20180214_1026.py b/smash/web/migrations/0103_auto_20180214_1026.py index d59dc089c6955e9985e1040fdc3ccf155023aac7..41a714e889691da1a4b9bd322732a92aad1b6238 100644 --- a/smash/web/migrations/0103_auto_20180214_1026.py +++ b/smash/web/migrations/0103_auto_20180214_1026.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2018-02-14 10:26 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0104_contact_required_list_update.py b/smash/web/migrations/0104_contact_required_list_update.py index 87e58febfa4a9805f679a920108176a06366686e..dbfb503e7e32a850b6e4cb2736289d2713b103c3 100644 --- a/smash/web/migrations/0104_contact_required_list_update.py +++ b/smash/web/migrations/0104_contact_required_list_update.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2018-02-14 10:26 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0105_unfinished_appointments_list_update.py b/smash/web/migrations/0105_unfinished_appointments_list_update.py index 7bd87a667301747e53b71bc3336c8ac70f637320..cfef1c66bec909c70ffbfbd7345a8d284dd1cc35 100644 --- a/smash/web/migrations/0105_unfinished_appointments_list_update.py +++ b/smash/web/migrations/0105_unfinished_appointments_list_update.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2018-02-14 10:26 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0106_approaching_post_mail_list_update.py b/smash/web/migrations/0106_approaching_post_mail_list_update.py index 1f37f6cde747d5834a083dd87c3733cb60415d2d..80e966cd89ec449da9546b151d54ff98059e2aa6 100644 --- a/smash/web/migrations/0106_approaching_post_mail_list_update.py +++ b/smash/web/migrations/0106_approaching_post_mail_list_update.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2018-02-14 10:26 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0107_exceeded_visit_time_list_update.py b/smash/web/migrations/0107_exceeded_visit_time_list_update.py index a4dc7b4ad27fda4e62ed9a22423a29d58f81b563..934b455ffa411359a9279d0f909ce2999ebbaf3d 100644 --- a/smash/web/migrations/0107_exceeded_visit_time_list_update.py +++ b/smash/web/migrations/0107_exceeded_visit_time_list_update.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2018-02-14 10:26 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0108_unfinished_visit_list_update.py b/smash/web/migrations/0108_unfinished_visit_list_update.py index 86469c033ec6684d8aeefd80e1967ab8f2b986b7..b357d3e21f91cb918eaa8f1869c5b3eb81fa8963 100644 --- a/smash/web/migrations/0108_unfinished_visit_list_update.py +++ b/smash/web/migrations/0108_unfinished_visit_list_update.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2018-02-14 10:26 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0109_missing_appointment_list_update.py b/smash/web/migrations/0109_missing_appointment_list_update.py index 799c768136b345a73ed6ecfedadc5e4153e16f3e..bbfc2d9dda4daa5d918e6d4a9404615019ac07f1 100644 --- a/smash/web/migrations/0109_missing_appointment_list_update.py +++ b/smash/web/migrations/0109_missing_appointment_list_update.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2018-02-14 10:26 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0110_auto_20180601_0754.py b/smash/web/migrations/0110_auto_20180601_0754.py index 2c8782702f04b11d11b85c7e6dde091187f8c5b4..159f4492fe63777ad19c50960df45b0be70089c8 100644 --- a/smash/web/migrations/0110_auto_20180601_0754.py +++ b/smash/web/migrations/0110_auto_20180601_0754.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2018-06-01 07:54 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0111_auto_20180601_1318.py b/smash/web/migrations/0111_auto_20180601_1318.py index d666a0b0b011d8e2b3d16b2aba6fcaf373a171a7..2c8bc8bda7b7bf3399a320e02e25b7b289742fad 100644 --- a/smash/web/migrations/0111_auto_20180601_1318.py +++ b/smash/web/migrations/0111_auto_20180601_1318.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2018-06-01 13:18 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0112_auto_20180604_1021.py b/smash/web/migrations/0112_auto_20180604_1021.py index 5d99ccd90a40da44049780bf713e00f2267f905c..f2a23b319195a274b8e9f21762de0b7553974a6f 100644 --- a/smash/web/migrations/0112_auto_20180604_1021.py +++ b/smash/web/migrations/0112_auto_20180604_1021.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2018-06-04 10:21 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0113_auto_20180608_1258.py b/smash/web/migrations/0113_auto_20180608_1258.py index 17ce67819f1f2c2598e1f320cb4fe51a6c7f74d7..a613eece55c4560a4b4c8f59a269d387bd9e2a64 100644 --- a/smash/web/migrations/0113_auto_20180608_1258.py +++ b/smash/web/migrations/0113_auto_20180608_1258.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2018-06-08 12:58 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0114_auto_20180611_0950.py b/smash/web/migrations/0114_auto_20180611_0950.py index 510157daf86e456fad233b0ab7d32af5452baa9a..7bf9361e2a0134f31aa83510e3f70543daa42587 100644 --- a/smash/web/migrations/0114_auto_20180611_0950.py +++ b/smash/web/migrations/0114_auto_20180611_0950.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2018-06-11 09:50 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0115_auto_20180611_0950.py b/smash/web/migrations/0115_auto_20180611_0950.py index 62cb787471b843b8cb36ef0107f65e3e67956e27..ec293acf2f506b534899449f36dcb9afb2f07ae2 100644 --- a/smash/web/migrations/0115_auto_20180611_0950.py +++ b/smash/web/migrations/0115_auto_20180611_0950.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2018-06-11 09:50 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0116_auto_20180611_1346.py b/smash/web/migrations/0116_auto_20180611_1346.py index a333ad8bb0e6c131c08b4e6633b44ab6b0c4af8f..5859c5dda4302fa8521c4e4b5ec7b5869f003515 100644 --- a/smash/web/migrations/0116_auto_20180611_1346.py +++ b/smash/web/migrations/0116_auto_20180611_1346.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2018-06-11 13:46 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0117_auto_20180717_1434.py b/smash/web/migrations/0117_auto_20180717_1434.py index ddc48c027953a13a8d5237dc5113fdfd3376afd4..c540dc823114e21f509803d1635f60b3df2dcfb6 100644 --- a/smash/web/migrations/0117_auto_20180717_1434.py +++ b/smash/web/migrations/0117_auto_20180717_1434.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2018-07-17 14:34 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0118_voucher_activity_type.py b/smash/web/migrations/0118_voucher_activity_type.py index 745425a78944445eff81f69a0ebbffd4acb30046..06d10c168e7a02c64aa94203a3e03ff9aa62443c 100644 --- a/smash/web/migrations/0118_voucher_activity_type.py +++ b/smash/web/migrations/0118_voucher_activity_type.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2018-07-17 12:54 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0119_auto_20181002_0908.py b/smash/web/migrations/0119_auto_20181002_0908.py index 3f3a9a06ccbba72db9a92a1f4a682fbcf19318c0..e6426d4147cf6432ad1021531f13c18c0163ab1f 100644 --- a/smash/web/migrations/0119_auto_20181002_0908.py +++ b/smash/web/migrations/0119_auto_20181002_0908.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-10-02 09:08 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0119_auto_20181015_1324.py b/smash/web/migrations/0119_auto_20181015_1324.py index 3f4d4840a0ac7dbcf05d93adf550587cb1412581..7ac5d1774e0e2ae1d0c221773fcd739180f1abe6 100644 --- a/smash/web/migrations/0119_auto_20181015_1324.py +++ b/smash/web/migrations/0119_auto_20181015_1324.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-10-15 13:24 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0119_auto_20181024_1158.py b/smash/web/migrations/0119_auto_20181024_1158.py index cab12fa337487854b82a8cf770efd1cda340dd36..ff17f157a9869d7284d817e91d59202c66d4c882 100644 --- a/smash/web/migrations/0119_auto_20181024_1158.py +++ b/smash/web/migrations/0119_auto_20181024_1158.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-10-24 11:58 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0120_holiday_kind.py b/smash/web/migrations/0120_holiday_kind.py index 688d8f04cbc5fc25594949c5d8d436c4bf58cc86..7f4a8482fcb687958c24a039f62a3f93f694e96b 100644 --- a/smash/web/migrations/0120_holiday_kind.py +++ b/smash/web/migrations/0120_holiday_kind.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-10-03 09:11 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0120_study_nd_number_study_subject_regex.py b/smash/web/migrations/0120_study_nd_number_study_subject_regex.py index 9b4146edb8a1bcdfbf19a3144c4e9b932ee0beb6..df7c895a0358cf6e52b748ce842a7d0cbb2e2039 100644 --- a/smash/web/migrations/0120_study_nd_number_study_subject_regex.py +++ b/smash/web/migrations/0120_study_nd_number_study_subject_regex.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-10-24 12:00 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0121_auto_20181003_1256.py b/smash/web/migrations/0121_auto_20181003_1256.py index a350af1604c22d5f97a0f6290a56ce2920c33155..c2018e15a7e3998169719eb1fddb618b488717e6 100644 --- a/smash/web/migrations/0121_auto_20181003_1256.py +++ b/smash/web/migrations/0121_auto_20181003_1256.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-10-03 12:56 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0121_auto_20181024_1859.py b/smash/web/migrations/0121_auto_20181024_1859.py index 2e0b4654936fdae97a6ddc06809d3a89918a17d9..9bb28cf07e705e74335e3498b27c9ecdab49fd38 100644 --- a/smash/web/migrations/0121_auto_20181024_1859.py +++ b/smash/web/migrations/0121_auto_20181024_1859.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-10-24 18:59 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0122_remove_worker_appointments.py b/smash/web/migrations/0122_remove_worker_appointments.py index b2df6305c497a1a49f0ac64d872f67c3c9d75d29..110a0e9bc2f9cc16448e5d33c835313a20d2efce 100644 --- a/smash/web/migrations/0122_remove_worker_appointments.py +++ b/smash/web/migrations/0122_remove_worker_appointments.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-10-10 12:29 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0123_merge_20181017_1532.py b/smash/web/migrations/0123_merge_20181017_1532.py index a805cf53f1733f6e230ff0e1b5012f08cb1dc0b2..16fccd5b63c7572fa61c4598f9d00eaf8f9cb876 100644 --- a/smash/web/migrations/0123_merge_20181017_1532.py +++ b/smash/web/migrations/0123_merge_20181017_1532.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-10-17 15:32 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0124_auto_20181017_1532.py b/smash/web/migrations/0124_auto_20181017_1532.py index 8ebc0e3b07022640ba756f344dc72f499b3ce28a..6b473d67079448875c076bfd4f5593fc94e86f7c 100644 --- a/smash/web/migrations/0124_auto_20181017_1532.py +++ b/smash/web/migrations/0124_auto_20181017_1532.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-10-17 15:32 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0125_merge_20181025_0745.py b/smash/web/migrations/0125_merge_20181025_0745.py index 9559a6193bdeeb50cef4d5ee8d27af03c56dbac1..4bef57c290b45dcec172d0405f197f1f64261f43 100644 --- a/smash/web/migrations/0125_merge_20181025_0745.py +++ b/smash/web/migrations/0125_merge_20181025_0745.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-10-25 07:45 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0126_auto_20181030_1733.py b/smash/web/migrations/0126_auto_20181030_1733.py index 95685160ed73cc2db73c1bb3203e2f7f07e225e9..1674a5bc96a2c5d4e35b28a8356d8180f472e26f 100644 --- a/smash/web/migrations/0126_auto_20181030_1733.py +++ b/smash/web/migrations/0126_auto_20181030_1733.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-10-30 17:33 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0127_auto_20181031_0959.py b/smash/web/migrations/0127_auto_20181031_0959.py index 1ea22a278f0232bcced072ab3a6b7af06becfa21..4807157dc86828c4e3b2a9e92cb1e28f579d15a2 100644 --- a/smash/web/migrations/0127_auto_20181031_0959.py +++ b/smash/web/migrations/0127_auto_20181031_0959.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-10-31 09:59 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0128_studycolumns_excluded.py b/smash/web/migrations/0128_studycolumns_excluded.py index 3814c094fc5b36c81bbde0ee409b805a3fb32418..b7d9b7c67be13d2cd0ff0e33ec058f20d1a27cd0 100644 --- a/smash/web/migrations/0128_studycolumns_excluded.py +++ b/smash/web/migrations/0128_studycolumns_excluded.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-10-31 10:16 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0129_auto_20181031_1348.py b/smash/web/migrations/0129_auto_20181031_1348.py index 3cad6e89ca098101e35fc79b8d1ce78d63f39b08..1ef867f38c837787625bbf73217d28ee624cf2d1 100644 --- a/smash/web/migrations/0129_auto_20181031_1348.py +++ b/smash/web/migrations/0129_auto_20181031_1348.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-10-31 13:48 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0130_study_visits_to_show_in_subject_list.py b/smash/web/migrations/0130_study_visits_to_show_in_subject_list.py index 071741cd8f575ff3254356110b915a4775bb8dff..fe530019fb69ab330e28c521ddecf349085f58a1 100644 --- a/smash/web/migrations/0130_study_visits_to_show_in_subject_list.py +++ b/smash/web/migrations/0130_study_visits_to_show_in_subject_list.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-11-06 15:37 -from __future__ import unicode_literals + import django.core.validators from django.db import migrations, models diff --git a/smash/web/migrations/0131_study_default_voucher_expiration_in_months.py b/smash/web/migrations/0131_study_default_voucher_expiration_in_months.py index 4e1e04ea0b0f2bf0177ffbcaaaa09cd7e0132be6..2a3c7413085ce1a067a334b8b2551b9b4a15f0cb 100644 --- a/smash/web/migrations/0131_study_default_voucher_expiration_in_months.py +++ b/smash/web/migrations/0131_study_default_voucher_expiration_in_months.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-11-09 15:47 -from __future__ import unicode_literals + import django.core.validators from django.db import migrations, models diff --git a/smash/web/migrations/0132_study_default_visit_duration_in_months.py b/smash/web/migrations/0132_study_default_visit_duration_in_months.py index 522e672e1041241ab5c52140cebbbc53b8be7bbc..02efe4efbbcd94924db0bc8dc33894623542229e 100644 --- a/smash/web/migrations/0132_study_default_visit_duration_in_months.py +++ b/smash/web/migrations/0132_study_default_visit_duration_in_months.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-11-13 10:05 -from __future__ import unicode_literals + import django.core.validators from django.db import migrations, models diff --git a/smash/web/migrations/0132_worker_comment.py b/smash/web/migrations/0132_worker_comment.py index 8457a0e93ded714450608c03bc1c56bb4f7a52c3..e4429baf3e51f938c45d126d9857dc26b6ff80d6 100644 --- a/smash/web/migrations/0132_worker_comment.py +++ b/smash/web/migrations/0132_worker_comment.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-12-04 10:31 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0132_workerstudyrole_permissions.py b/smash/web/migrations/0132_workerstudyrole_permissions.py index 58d0fc3b90139a91371aea5c14249e66a6481ebc..4477be4d93ae9084f935a4c7727f4fe26476ffbb 100644 --- a/smash/web/migrations/0132_workerstudyrole_permissions.py +++ b/smash/web/migrations/0132_workerstudyrole_permissions.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-11-19 10:43 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0133_auto_20181113_1550.py b/smash/web/migrations/0133_auto_20181113_1550.py index efc19768b94521fcc1c12fcdaf030d640d94a8f7..7771620ca0688bcd9cdc7ec2ebfa1af53df26027 100644 --- a/smash/web/migrations/0133_auto_20181113_1550.py +++ b/smash/web/migrations/0133_auto_20181113_1550.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-11-13 15:50 -from __future__ import unicode_literals + import django.core.validators from django.db import migrations, models diff --git a/smash/web/migrations/0134_merge_20181211_1542.py b/smash/web/migrations/0134_merge_20181211_1542.py index 9ea20794127870e032566c49af3e2d438e0c7acd..cd87ff53777085aebdb269654e1927ca5264f8ae 100644 --- a/smash/web/migrations/0134_merge_20181211_1542.py +++ b/smash/web/migrations/0134_merge_20181211_1542.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-12-11 15:42 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0135_merge_20181212_1333.py b/smash/web/migrations/0135_merge_20181212_1333.py index 2bfc9cb114af90acd1de3133b863949ccefe8395..d28d969be7ef999ebbeaf26e0407a169aef10bf8 100644 --- a/smash/web/migrations/0135_merge_20181212_1333.py +++ b/smash/web/migrations/0135_merge_20181212_1333.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-12-12 13:33 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0135_merge_20190108_1336.py b/smash/web/migrations/0135_merge_20190108_1336.py index 2c20dc4f098ef8ae56733e6016b304709dbf7bc7..071ed70868ee56b7e68750bcd21670104d301aea 100644 --- a/smash/web/migrations/0135_merge_20190108_1336.py +++ b/smash/web/migrations/0135_merge_20190108_1336.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2019-01-08 13:36 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0136_merge_20190109_1041.py b/smash/web/migrations/0136_merge_20190109_1041.py index 5f46a33ae77db098625504c5f030b01f384f009f..3d40bb3651dbd66614a6e0986534d5b5c5db562c 100644 --- a/smash/web/migrations/0136_merge_20190109_1041.py +++ b/smash/web/migrations/0136_merge_20190109_1041.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2019-01-09 10:41 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0137_auto_20190321_1024.py b/smash/web/migrations/0137_auto_20190321_1024.py index f66a1b4362a00254197bace345a18a544da32f76..3efceba18d481bcfcab15942bf2a64bf89623cf0 100644 --- a/smash/web/migrations/0137_auto_20190321_1024.py +++ b/smash/web/migrations/0137_auto_20190321_1024.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2019-03-21 10:24 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0138_auto_20190321_1111.py b/smash/web/migrations/0138_auto_20190321_1111.py index 19badc517c216ace1d385dec67da04c947cba11d..d2fc222f913e366da4faff9d9d5cdecd8f1559c6 100644 --- a/smash/web/migrations/0138_auto_20190321_1111.py +++ b/smash/web/migrations/0138_auto_20190321_1111.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2019-03-21 11:11 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0139_auto_20190321_1400.py b/smash/web/migrations/0139_auto_20190321_1400.py index f47c0ebb94d54deae96253bf320c378ab92bbf51..3c1d389a7f71ae6ec479d043eb984fd0813cdbda 100644 --- a/smash/web/migrations/0139_auto_20190321_1400.py +++ b/smash/web/migrations/0139_auto_20190321_1400.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2019-03-21 14:00 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0140_auto_20190528_0953.py b/smash/web/migrations/0140_auto_20190528_0953.py index 0c120aaccbfb45cd36d3daa5f97d9c01a2e88f21..e573406c0b806860c80ae341b3745fe8beb7222a 100644 --- a/smash/web/migrations/0140_auto_20190528_0953.py +++ b/smash/web/migrations/0140_auto_20190528_0953.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2019-05-28 09:53 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0141_auto_20200319_1040.py b/smash/web/migrations/0141_auto_20200319_1040.py index a47dfea4765b67f9455d92a7234844ad40ae73ed..5e2d11e0858a8858e7d09aee5abf28a907cf7cef 100644 --- a/smash/web/migrations/0141_auto_20200319_1040.py +++ b/smash/web/migrations/0141_auto_20200319_1040.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-03-19 10:40 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0142_provenance.py b/smash/web/migrations/0142_provenance.py index 34e1568b71a6a267beeef1f3793c2f1252255be5..99a9099f760d1098b3e2ee22c980ec0c21c365c6 100644 --- a/smash/web/migrations/0142_provenance.py +++ b/smash/web/migrations/0142_provenance.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-03-19 10:50 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0143_auto_20200319_1121.py b/smash/web/migrations/0143_auto_20200319_1121.py index 57b5f92d46ca0a2346d91164f552407fa46a4ed5..4c651a39b1af26f32dfb25c14214273e9231a4b7 100644 --- a/smash/web/migrations/0143_auto_20200319_1121.py +++ b/smash/web/migrations/0143_auto_20200319_1121.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-03-19 11:21 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0144_auto_20200319_1221.py b/smash/web/migrations/0144_auto_20200319_1221.py index a232453bb6bb96bd20d1f7dbe5510454a9fa85cf..b4eab423f46407a84edb253c216077caa0c4ded8 100644 --- a/smash/web/migrations/0144_auto_20200319_1221.py +++ b/smash/web/migrations/0144_auto_20200319_1221.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-03-19 12:21 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0145_auto_20200319_1404.py b/smash/web/migrations/0145_auto_20200319_1404.py index fda7e5189461e4375b4b95e177a553b9f0955bd0..43b2724511c4b7a0818effbd98a3a70c38a7b973 100644 --- a/smash/web/migrations/0145_auto_20200319_1404.py +++ b/smash/web/migrations/0145_auto_20200319_1404.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-03-19 14:04 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0146_auto_20200319_1446.py b/smash/web/migrations/0146_auto_20200319_1446.py index 8cd04b4486246d6dd67b724fe62121db273d4c41..663d50247fe81ce09950865a8090bf7719edaa42 100644 --- a/smash/web/migrations/0146_auto_20200319_1446.py +++ b/smash/web/migrations/0146_auto_20200319_1446.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-03-19 14:46 -from __future__ import unicode_literals + from django.db import migrations, models import django.db.models.deletion diff --git a/smash/web/migrations/0147_auto_20200320_0931.py b/smash/web/migrations/0147_auto_20200320_0931.py index 58a3dc901515fa768382f239352409bb6a7a9ed8..39cf0185b00409aeab5fefae207ec674fbf29c2a 100644 --- a/smash/web/migrations/0147_auto_20200320_0931.py +++ b/smash/web/migrations/0147_auto_20200320_0931.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-03-20 09:31 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0148_auto_20200319_1301.py b/smash/web/migrations/0148_auto_20200319_1301.py index 1b2abecbe955819c77d988944336b22ad28bd016..301a3d5eb3ca7a95f71c89c618b2655f07cef5dc 100644 --- a/smash/web/migrations/0148_auto_20200319_1301.py +++ b/smash/web/migrations/0148_auto_20200319_1301.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-03-19 13:01 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0149_auto_20200319_1415.py b/smash/web/migrations/0149_auto_20200319_1415.py index c948e9780d3d5da309c62035ff5afb27f0d835fc..b695eec21d8f683d25a90f3325e3b34bdb409b5c 100644 --- a/smash/web/migrations/0149_auto_20200319_1415.py +++ b/smash/web/migrations/0149_auto_20200319_1415.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-03-19 14:15 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0150_auto_20200319_1446.py b/smash/web/migrations/0150_auto_20200319_1446.py index 0fcdea7e40cf414c94558b82d7befe42e7dbc275..44878a59bf859ccbd6a9a03d3722445ba013c92b 100644 --- a/smash/web/migrations/0150_auto_20200319_1446.py +++ b/smash/web/migrations/0150_auto_20200319_1446.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-03-19 14:46 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0151_auto_20200319_1518.py b/smash/web/migrations/0151_auto_20200319_1518.py index a034d7b50283e5a6011cbcf3e9bf24a465c0cfcb..6c7f857faefafa1fd872a7644539c59c38023e47 100644 --- a/smash/web/migrations/0151_auto_20200319_1518.py +++ b/smash/web/migrations/0151_auto_20200319_1518.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-03-19 15:18 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0152_add_permissions_to_existing_workers.py b/smash/web/migrations/0152_add_permissions_to_existing_workers.py index 67752e4690b59643da8f7ae2fe375db39a43f2a2..bbd34eb0438de342f5a2fc6be31afc03305ad2b8 100644 --- a/smash/web/migrations/0152_add_permissions_to_existing_workers.py +++ b/smash/web/migrations/0152_add_permissions_to_existing_workers.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-03-19 13:01 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0153_auto_20200320_0932.py b/smash/web/migrations/0153_auto_20200320_0932.py index 06a7de106240cf856fceb9720477be0b9aa87526..f68d08e752c2353a01a4c527c7f5912a2e8cc4a4 100644 --- a/smash/web/migrations/0153_auto_20200320_0932.py +++ b/smash/web/migrations/0153_auto_20200320_0932.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-03-20 09:32 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0154_add_permission_to_existing_workers.py b/smash/web/migrations/0154_add_permission_to_existing_workers.py index 76d2ca30d1e461f10b09a110f1b3d66d036dff4f..a9b8e64ba4dc7e16a09a9798742730af904eaabf 100644 --- a/smash/web/migrations/0154_add_permission_to_existing_workers.py +++ b/smash/web/migrations/0154_add_permission_to_existing_workers.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-03-19 13:01 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0155_auto_20200406_1144.py b/smash/web/migrations/0155_auto_20200406_1144.py index 438315eef6d19f38f08b0f8e04255c59bd2ad612..8bbdb621e85d7e699e186319c525705458e99d74 100644 --- a/smash/web/migrations/0155_auto_20200406_1144.py +++ b/smash/web/migrations/0155_auto_20200406_1144.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-04-06 11:44 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0156_auto_20200406_1207.py b/smash/web/migrations/0156_auto_20200406_1207.py index dc0544dbc712148c6d38ad9e14c7eb29ba92541a..8f881939cf77da753018cb8a4ea1836b820331ca 100644 --- a/smash/web/migrations/0156_auto_20200406_1207.py +++ b/smash/web/migrations/0156_auto_20200406_1207.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-04-06 12:07 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0157_auto_20200414_0909.py b/smash/web/migrations/0157_auto_20200414_0909.py index a1c759826e330b4299e320882a29413dd3768265..dd93ae2a5a56376b224a5d398f8ab18125cb8718 100644 --- a/smash/web/migrations/0157_auto_20200414_0909.py +++ b/smash/web/migrations/0157_auto_20200414_0909.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-04-14 09:09 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0158_configurationitem_email_items.py b/smash/web/migrations/0158_configurationitem_email_items.py index 046dd4d4941d65b64150a4ae562955c7ae5986f8..8cb29f2cf0d00eb4e1cda0ab72c246e2140045d4 100644 --- a/smash/web/migrations/0158_configurationitem_email_items.py +++ b/smash/web/migrations/0158_configurationitem_email_items.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-04 09:43 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0159_configurationitem_email_items_for_redcap.py b/smash/web/migrations/0159_configurationitem_email_items_for_redcap.py index f496a5a3f92489be49b66ac9dbac156eb07e46db..14050e0541df2f94fefb1cd04e4d64494fa5e755 100644 --- a/smash/web/migrations/0159_configurationitem_email_items_for_redcap.py +++ b/smash/web/migrations/0159_configurationitem_email_items_for_redcap.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-04 09:43 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0160_auto_20200415_1101.py b/smash/web/migrations/0160_auto_20200415_1101.py index f00f970dcc844171d9c43b7743823b5e4b2772bb..aa1dfa9a90bc3d429a4e20df30647d613286c27e 100644 --- a/smash/web/migrations/0160_auto_20200415_1101.py +++ b/smash/web/migrations/0160_auto_20200415_1101.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-04-15 11:01 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0161_auto_20200416_0736.py b/smash/web/migrations/0161_auto_20200416_0736.py index babe517464ca8315c824671d5c8d625bce3ec907..187b6b703e1dc70959f10d729ae1032687d25669 100644 --- a/smash/web/migrations/0161_auto_20200416_0736.py +++ b/smash/web/migrations/0161_auto_20200416_0736.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-04-16 07:36 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0162_auto_20200416_1212.py b/smash/web/migrations/0162_auto_20200416_1212.py index 9e2bf7c91f719ca93400c4e47b5b206036833394..2e84b8fc427a1558944419b9aa87ed5d625eb550 100644 --- a/smash/web/migrations/0162_auto_20200416_1212.py +++ b/smash/web/migrations/0162_auto_20200416_1212.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-04-16 12:12 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0163_study_redcap_first_visit_number.py b/smash/web/migrations/0163_study_redcap_first_visit_number.py index e518d8ef98accd9b26caad3e036d12ee6147c0cb..7a4884b6673a55d58299982930d5082eced5e1c1 100644 --- a/smash/web/migrations/0163_study_redcap_first_visit_number.py +++ b/smash/web/migrations/0163_study_redcap_first_visit_number.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-04-16 12:36 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0164_configurationitem_email_items_for_redcap.py b/smash/web/migrations/0164_configurationitem_email_items_for_redcap.py index efa3e50fdb36463fe9a08bc86af80be75f738d1b..75fd7b779439131d11f19e8be9dda022f4fcec54 100644 --- a/smash/web/migrations/0164_configurationitem_email_items_for_redcap.py +++ b/smash/web/migrations/0164_configurationitem_email_items_for_redcap.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-04 09:43 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0165_configurationitem_email_virus.py b/smash/web/migrations/0165_configurationitem_email_virus.py index 0feeb5ddfd2fe8a12f49e8baf4d858b4ebf78438..12452f907dc871043f13d8f2843603d17d9ca1aa 100644 --- a/smash/web/migrations/0165_configurationitem_email_virus.py +++ b/smash/web/migrations/0165_configurationitem_email_virus.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-04 09:43 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0166_auto_20200423_1457.py b/smash/web/migrations/0166_auto_20200423_1457.py index 093f4bb6dd5e998fa900385b6ddd749f6fea3936..66cdf944095ef3b56d15aa18889e9c143840c823 100644 --- a/smash/web/migrations/0166_auto_20200423_1457.py +++ b/smash/web/migrations/0166_auto_20200423_1457.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-04-23 14:57 -from __future__ import unicode_literals + from web.models.constants import VISIT_SHOW_VISIT_NUMBER_FROM_ZERO from django.db import migrations diff --git a/smash/web/migrations/0167_auto_20200428_1110.py b/smash/web/migrations/0167_auto_20200428_1110.py index ea95418d62f1f5c1e0f7261d61771386f094910a..442dff958a80bb28946618b391a57eb056d6964f 100644 --- a/smash/web/migrations/0167_auto_20200428_1110.py +++ b/smash/web/migrations/0167_auto_20200428_1110.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-04-28 11:10 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0168_rename_radcap_field.py b/smash/web/migrations/0168_rename_radcap_field.py index be1108a551db354f331dd1c3e70ad4000884a3c6..9a5980708adb2bc17afcc0dedd91eccaae5452d1 100644 --- a/smash/web/migrations/0168_rename_radcap_field.py +++ b/smash/web/migrations/0168_rename_radcap_field.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0169_auto_20200525_1123.py b/smash/web/migrations/0169_auto_20200525_1123.py index ecc26be110b775612d237ce09f3106c54637b69e..c3a55bf4659061ca25067e42e74113ea5ab051e5 100644 --- a/smash/web/migrations/0169_auto_20200525_1123.py +++ b/smash/web/migrations/0169_auto_20200525_1123.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-05-25 11:23 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0170_auto_20200525_1126.py b/smash/web/migrations/0170_auto_20200525_1126.py index 4f70a352988530f0e3197b8c3a2f3643f24c9e30..972aa79d4608648c06f76f3d28763add00dbf905 100644 --- a/smash/web/migrations/0170_auto_20200525_1126.py +++ b/smash/web/migrations/0170_auto_20200525_1126.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-05-25 11:26 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/migrations/0171_configurationitem_serology.py b/smash/web/migrations/0171_configurationitem_serology.py index 824e53812bbba51df241cc288c8c632ec7824d3a..7da0a6ff53665dc1204b1e018dfb6eae5b598095 100644 --- a/smash/web/migrations/0171_configurationitem_serology.py +++ b/smash/web/migrations/0171_configurationitem_serology.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-04 09:43 -from __future__ import unicode_literals + from django.db import migrations diff --git a/smash/web/migrations/0172_auto_20200525_1246.py b/smash/web/migrations/0172_auto_20200525_1246.py index 0750d0a95f4345c01d41b45334aa373c66125d1e..8f5e039a2f9cf7e225199377e1dd9515f823ff9f 100644 --- a/smash/web/migrations/0172_auto_20200525_1246.py +++ b/smash/web/migrations/0172_auto_20200525_1246.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2020-05-25 12:46 -from __future__ import unicode_literals + from django.db import migrations, models diff --git a/smash/web/models/__init__.py b/smash/web/models/__init__.py index ee5fdb79d7681d2cd9a10e0fdde4d862e136ed39..9c193eaa042b0662683c6f399f21b5053222e89d 100644 --- a/smash/web/models/__init__.py +++ b/smash/web/models/__init__.py @@ -1,43 +1,43 @@ # coding=utf-8 -from __future__ import unicode_literals + from django.contrib.auth.models import User -from provenance import Provenance -from configuration_item import ConfigurationItem -from flying_team import FlyingTeam -from location import Location -from appointment_type_link import AppointmentTypeLink -from country import Country -from appointment_columns import AppointmentColumns -from subject_columns import SubjectColumns -from study_columns import StudyColumns -from redcap_columns import StudyRedCapColumns -from visit_columns import VisitColumns -from notification_columns import StudyNotificationParameters -from study import Study -from voucher_type import VoucherType -from voucher_type_price import VoucherTypePrice -from room import Room -from visit import Visit -from worker import Worker -from worker_study_role import WorkerStudyRole -from appointment import Appointment -from appointment_type import AppointmentType -from availability import Availability -from holiday import Holiday -from item import Item -from language import Language -from subject import Subject -from study_subject import StudySubject -from voucher import Voucher -from study_subject_list import StudySubjectList -from study_visit_list import StudyVisitList -from appointment_list import AppointmentList -from contact_attempt import ContactAttempt -from mail_template import MailTemplate -from missing_subject import MissingSubject -from inconsistent_subject import InconsistentSubject, InconsistentField +from .provenance import Provenance +from .configuration_item import ConfigurationItem +from .flying_team import FlyingTeam +from .location import Location +from .appointment_type_link import AppointmentTypeLink +from .country import Country +from .appointment_columns import AppointmentColumns +from .subject_columns import SubjectColumns +from .study_columns import StudyColumns +from .redcap_columns import StudyRedCapColumns +from .visit_columns import VisitColumns +from .notification_columns import StudyNotificationParameters +from .study import Study +from .voucher_type import VoucherType +from .voucher_type_price import VoucherTypePrice +from .room import Room +from .visit import Visit +from .worker import Worker +from .worker_study_role import WorkerStudyRole +from .appointment import Appointment +from .appointment_type import AppointmentType +from .availability import Availability +from .holiday import Holiday +from .item import Item +from .language import Language +from .subject import Subject +from .study_subject import StudySubject +from .voucher import Voucher +from .study_subject_list import StudySubjectList +from .study_visit_list import StudyVisitList +from .appointment_list import AppointmentList +from .contact_attempt import ContactAttempt +from .mail_template import MailTemplate +from .missing_subject import MissingSubject +from .inconsistent_subject import InconsistentSubject, InconsistentField __all__ = [Study, FlyingTeam, Appointment, AppointmentType, Availability, Holiday, Item, Language, Location, Room, Subject, StudySubject, StudySubjectList, SubjectColumns, StudyNotificationParameters, diff --git a/smash/web/models/appointment.py b/smash/web/models/appointment.py index c7a52d416f21c313e7930088f85944c91f35cd50..2dac8a1310fcba945995a6648147c0bd250a6fd7 100644 --- a/smash/web/models/appointment.py +++ b/smash/web/models/appointment.py @@ -3,7 +3,7 @@ import datetime from django.db import models -from constants import APPOINTMENT_TYPE_DEFAULT_COLOR, APPOINTMENT_TYPE_DEFAULT_FONT_COLOR, \ +from .constants import APPOINTMENT_TYPE_DEFAULT_COLOR, APPOINTMENT_TYPE_DEFAULT_FONT_COLOR, \ CANCELLED_APPOINTMENT_COLOR_CONFIGURATION_TYPE, NO_SHOW_APPOINTMENT_COLOR_CONFIGURATION_TYPE from . import ConfigurationItem @@ -68,7 +68,7 @@ class Appointment(models.Model): verbose_name='Appointment length (in minutes)' ) # Potentially redundant; but can be used to manually adjust appointment's length - status = models.CharField(max_length=20, choices=APPOINTMENT_STATUS_CHOICES.items(), + status = models.CharField(max_length=20, choices=list(APPOINTMENT_STATUS_CHOICES.items()), verbose_name='Status', default=APPOINTMENT_STATUS_SCHEDULED ) diff --git a/smash/web/models/appointment_list.py b/smash/web/models/appointment_list.py index e04142320afcd4dddbd82ab6b4cf1dbc9efcb61c..4a803264108c15ef97eb6d71350249acd05c47dd 100644 --- a/smash/web/models/appointment_list.py +++ b/smash/web/models/appointment_list.py @@ -47,6 +47,6 @@ class AppointmentList(models.Model): ) type = models.CharField(max_length=50, - choices=APPOINTMENT_LIST_CHOICES.items(), + choices=list(APPOINTMENT_LIST_CHOICES.items()), verbose_name='Type of list', ) diff --git a/smash/web/models/appointment_type.py b/smash/web/models/appointment_type.py index c8c4849a1d8f1481cfd465b53f2262f1ef06d939..76e9663741633a45f4424b374263f22d32ff5d5f 100644 --- a/smash/web/models/appointment_type.py +++ b/smash/web/models/appointment_type.py @@ -1,7 +1,7 @@ # coding=utf-8 from django.db import models -from constants import APPOINTMENT_TYPE_DEFAULT_COLOR, APPOINTMENT_TYPE_DEFAULT_FONT_COLOR +from .constants import APPOINTMENT_TYPE_DEFAULT_COLOR, APPOINTMENT_TYPE_DEFAULT_FONT_COLOR class AppointmentType(models.Model): diff --git a/smash/web/models/availability.py b/smash/web/models/availability.py index 330e2cc204af7cb9294e652d44144fbedb9f1c79..68580c2a57fc4ec47e33d12ccd8810f7a4dca14e 100644 --- a/smash/web/models/availability.py +++ b/smash/web/models/availability.py @@ -2,7 +2,7 @@ from django.db import models -from constants import WEEKDAY_CHOICES +from .constants import WEEKDAY_CHOICES class Availability(models.Model): diff --git a/smash/web/models/contact_attempt.py b/smash/web/models/contact_attempt.py index e8a2608e2b78655add178a3d09de4570137a5545..8eec61db67dd0597de95e0c13c02f025c8b01a44 100644 --- a/smash/web/models/contact_attempt.py +++ b/smash/web/models/contact_attempt.py @@ -1,7 +1,7 @@ # coding=utf-8 from django.db import models -from constants import CONTACT_TYPES_CHOICES, CONTACT_TYPES_PHONE +from .constants import CONTACT_TYPES_CHOICES, CONTACT_TYPES_PHONE __author__ = 'Valentin Grouès' diff --git a/smash/web/models/holiday.py b/smash/web/models/holiday.py index 927daa54340fd643e7ddd81a8f79e701238dbd7e..40ff05e47a0203c42557f3c07b1c71735b1bd2ea 100644 --- a/smash/web/models/holiday.py +++ b/smash/web/models/holiday.py @@ -1,7 +1,7 @@ # coding=utf-8 from django.db import models -from constants import AVAILABILITY_CHOICES, AVAILABILITY_HOLIDAY +from .constants import AVAILABILITY_CHOICES, AVAILABILITY_HOLIDAY class Holiday(models.Model): class Meta: diff --git a/smash/web/models/inconsistent_subject.py b/smash/web/models/inconsistent_subject.py index d50564e7e93b5f1aa4d98a152c15bb32bac9c8ed..aacdf1189c49748a708b263e0fe4214cf9fa609e 100644 --- a/smash/web/models/inconsistent_subject.py +++ b/smash/web/models/inconsistent_subject.py @@ -70,4 +70,4 @@ class InconsistentSubject(models.Model): return "Subject: " + str(self.subject) def __unicode__(self): - return "Subject: " + unicode(self.subject) + return "Subject: " + str(self.subject) diff --git a/smash/web/models/language.py b/smash/web/models/language.py index 5848ace6180745d33749f3140e618803dffcce02..564811c0440dbe3866c95333f00f3e2ad3b9e7b1 100644 --- a/smash/web/models/language.py +++ b/smash/web/models/language.py @@ -23,7 +23,7 @@ class Language(models.Model): def image_img(self): if self.image: - return u'<img class="flag-icon" src="%s" />' % self.image.url + return '<img class="flag-icon" src="%s" />' % self.image.url else: return 'No image' diff --git a/smash/web/models/mail_template.py b/smash/web/models/mail_template.py index e23d67babf272fb4a63a772a26ee33512eb28ac0..704870cfe5c9ccb9c0906f5584f8809a130ebfd5 100644 --- a/smash/web/models/mail_template.py +++ b/smash/web/models/mail_template.py @@ -245,7 +245,7 @@ class MailTemplate(models.Model): return { "##DATE_FULL##": current_datetime.strftime(DATE_FORMAT_FULL).decode(date_format_encoding()), "##DATE_SHORT##": current_datetime.strftime(DATE_FORMAT_SHORT).decode(date_format_encoding()), - "##WORKER##": unicode(worker), + "##WORKER##": str(worker), "##WORKER_EMAIL##": email } @@ -273,11 +273,11 @@ class MailTemplate(models.Model): "##A_DATE_FULL##": appointment_date_full, "##A_DATE_SHORT##": appointment_date_short, "##A_TIME##": appointment_date_time, - "##A_FLYING_TEAM##": unicode(appointment.flying_team), + "##A_FLYING_TEAM##": str(appointment.flying_team), "##A_STATUS##": appointment.get_status_display(), "##A_LOCATION##": appointment.location.name, - "##A_LOCATION_OR_FLYINGTEAM##": unicode(appointment.flying_team) or appointment.location.name, - "##A_WORKER##": unicode(appointment.worker_assigned), + "##A_LOCATION_OR_FLYINGTEAM##": str(appointment.flying_team) or appointment.location.name, + "##A_WORKER##": str(appointment.worker_assigned), '##A_WORKER_PHONE##': worker_phone_number, '##A_WORKER_EMAIL##': worker_email_address, "##A_ROOM##": str(appointment.room), @@ -303,23 +303,23 @@ class MailTemplate(models.Model): if study_subject is not None: date_born = date_to_str(study_subject.subject.date_born, DATE_FORMAT_SHORT) result = { - "##S_FULL_NAME##": unicode(study_subject), + "##S_FULL_NAME##": str(study_subject), "##S_FIRST_NAME##": study_subject.subject.first_name, "##S_LAST_NAME##": study_subject.subject.last_name, "##S_ADDRESS##": study_subject.subject.address, "##S_CITY##": study_subject.subject.city, - "##S_COUNTRY##": unicode(study_subject.subject.country), + "##S_COUNTRY##": str(study_subject.subject.country), "##S_DIAGNOSIS_YEAR##": str(study_subject.year_of_diagnosis), "##S_DATE_ADDED##": date_to_str(study_subject.date_added, DATE_FORMAT_SHORT), "##S_DATE_BORN##": date_born, - "##S_DIAGNOSIS##": unicode(study_subject.diagnosis), - "##S_EMAIL##": unicode(study_subject.subject.email), + "##S_DIAGNOSIS##": str(study_subject.diagnosis), + "##S_EMAIL##": str(study_subject.subject.email), "##S_SEX##": study_subject.subject.get_sex_display(), "##S_MPOWER_ID##": study_subject.mpower_id, "##S_ND_NUMBER##": study_subject.nd_number, - "##S_PHONE_NUMBER##": unicode(study_subject.subject.phone_number), - "##S_PHONE_NUMBER_2##": unicode(study_subject.subject.phone_number_2), - "##S_PHONE_NUMBER_3##": unicode(study_subject.subject.phone_number_3), + "##S_PHONE_NUMBER##": str(study_subject.subject.phone_number), + "##S_PHONE_NUMBER_2##": str(study_subject.subject.phone_number_2), + "##S_PHONE_NUMBER_3##": str(study_subject.subject.phone_number_3), "##S_POST_CODE##": study_subject.subject.postal_code, "##S_SCREENING_NUMBER##": study_subject.screening_number, "##S_TYPE##": study_subject.get_type_display(), @@ -327,10 +327,10 @@ class MailTemplate(models.Model): '##S_KNOWN_LANGUAGES##': ", ".join([l.name for l in study_subject.subject.languages.all()]) } if study_subject.health_partner is not None: - result["##S_HEALTH_PARTNER_NAME##"] = unicode(study_subject.health_partner.name) - result["##S_HEALTH_PARTNER_ADDRESS##"] = unicode(study_subject.health_partner.address) - result["##S_HEALTH_PARTNER_ZIP_CODE##"] = unicode(study_subject.health_partner.postal_code) - result["##S_HEALTH_PARTNER_CITY##"] = unicode(study_subject.health_partner.city) + result["##S_HEALTH_PARTNER_NAME##"] = str(study_subject.health_partner.name) + result["##S_HEALTH_PARTNER_ADDRESS##"] = str(study_subject.health_partner.address) + result["##S_HEALTH_PARTNER_ZIP_CODE##"] = str(study_subject.health_partner.postal_code) + result["##S_HEALTH_PARTNER_CITY##"] = str(study_subject.health_partner.city) else: result["##S_HEALTH_PARTNER_NAME##"] = "" result["##S_HEALTH_PARTNER_ADDRESS##"] = "" @@ -388,7 +388,7 @@ class MailTemplate(models.Model): "##C_PARTNER_ADDRESS##": voucher.usage_partner.address, "##C_PARTNER_POSTAL_CODE##": voucher.usage_partner.postal_code, "##C_PARTNER_CITY##": voucher.usage_partner.city, - "##C_PARTNER_COUNTRY##": unicode(voucher.usage_partner.country), + "##C_PARTNER_COUNTRY##": str(voucher.usage_partner.country), "##C_PARTNER_PHONE##": voucher.usage_partner.phone_number, "##C_HOURS##": str(voucher.hours), } diff --git a/smash/web/models/study.py b/smash/web/models/study.py index ed1fa433b140ad626c5746f5440a1ee6143b5ef0..dafb713e79907640f2b0e3cc8223a28387d3c1df 100644 --- a/smash/web/models/study.py +++ b/smash/web/models/study.py @@ -87,7 +87,7 @@ class Study(models.Model): ) default_delta_time_for_follow_up_units = models.CharField(max_length=10, - choices=FOLLOW_UP_INCREMENT_UNIT_CHOICE.items(), + choices=list(FOLLOW_UP_INCREMENT_UNIT_CHOICE.items()), verbose_name='Units for the follow up incrementals', help_text='Units for the number of days between visits for both patients and controls', default=FOLLOW_UP_INCREMENT_IN_YEARS, diff --git a/smash/web/models/study_subject.py b/smash/web/models/study_subject.py index a92c4c2c483488bd121a60374870da23fc3e90e1..5e4c14a59f2c3cdd8b344e4f4961cf596960486a 100644 --- a/smash/web/models/study_subject.py +++ b/smash/web/models/study_subject.py @@ -71,7 +71,7 @@ class StudySubject(models.Model): verbose_name='Please make a contact on', ) type = models.CharField(max_length=1, - choices=SUBJECT_TYPE_CHOICES.items(), + choices=list(SUBJECT_TYPE_CHOICES.items()), verbose_name='Type', null=True, blank=True diff --git a/smash/web/models/study_subject_list.py b/smash/web/models/study_subject_list.py index 8813f34b1ac1bb0d5b86dd937779de26dbf79fd7..1aa9a773b7e03194c0478ba0cfb89d32600d1846 100644 --- a/smash/web/models/study_subject_list.py +++ b/smash/web/models/study_subject_list.py @@ -49,7 +49,7 @@ class StudySubjectList(models.Model): ) type = models.CharField(max_length=50, - choices=SUBJECT_LIST_CHOICES.items(), + choices=list(SUBJECT_LIST_CHOICES.items()), verbose_name='Type of list', null=True, blank=True diff --git a/smash/web/models/study_visit_list.py b/smash/web/models/study_visit_list.py index 1d67e3253dfaa20fc127c21be26d9e0527556c0b..6d363ce22bb3d9b8703824141f5394c5c1608c47 100644 --- a/smash/web/models/study_visit_list.py +++ b/smash/web/models/study_visit_list.py @@ -59,6 +59,6 @@ class StudyVisitList(models.Model): ) type = models.CharField(max_length=50, - choices=VISIT_LIST_CHOICES.items(), + choices=list(VISIT_LIST_CHOICES.items()), verbose_name='Type of list', ) diff --git a/smash/web/models/subject.py b/smash/web/models/subject.py index 8781279a53a0009aae8981e3da500fad5fbde508..34b6cec5113f4abf77aebca7b9ca9e2ccda77995 100644 --- a/smash/web/models/subject.py +++ b/smash/web/models/subject.py @@ -5,7 +5,7 @@ from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver -from constants import SEX_CHOICES, COUNTRY_OTHER_ID +from .constants import SEX_CHOICES, COUNTRY_OTHER_ID from web.models import Country, Visit, Appointment, Provenance from . import Language @@ -127,7 +127,7 @@ class Subject(models.Model): ) def pretty_address(self): - return u'{} ({}), {}. {}'.format(self.address, self.postal_code, self.city, self.country) + return '{} ({}), {}. {}'.format(self.address, self.postal_code, self.city, self.country) def mark_as_dead(self): self.dead = True @@ -161,7 +161,7 @@ def set_as_deceased(sender, instance, **kwargs): p = Provenance(modified_table = Subject._meta.db_table, modified_table_id = instance.id, modification_author = None, previous_value = instance.dead, new_value = True, - modification_description = u'Subject "{}" marked as dead'.format(instance), + modification_description = 'Subject "{}" marked as dead'.format(instance), modified_field = 'dead', ) instance.mark_as_dead() diff --git a/smash/web/models/voucher_type.py b/smash/web/models/voucher_type.py index e726c23bfb3b7bd4a0fd8cbe3f1df641a520d47a..99829ec7e4e70c2732ec4c5102680fa6022ded92 100644 --- a/smash/web/models/voucher_type.py +++ b/smash/web/models/voucher_type.py @@ -22,4 +22,4 @@ class VoucherType(models.Model): return "%s (%s)" % (self.code, self.description) def __unicode__(self): - return u'{} ({})'.format(self.code, self.description) \ No newline at end of file + return '{} ({})'.format(self.code, self.description) \ No newline at end of file diff --git a/smash/web/models/worker.py b/smash/web/models/worker.py index 3cfc4199a18f9ce24c743e7c7be6cd4cb7fcfbba..6ccb96750ea41c81a1b2bf7560605a7765b52f64 100644 --- a/smash/web/models/worker.py +++ b/smash/web/models/worker.py @@ -205,7 +205,7 @@ class Worker(models.Model): start_date = start_date.replace(hour=0, minute=0, second=0) end_date = start_date + datetime.timedelta(days=1) - office_availability = OfficeAvailability(u'{} {}'.format(self.first_name, self.last_name), start=start_date, end=end_date) + office_availability = OfficeAvailability('{} {}'.format(self.first_name, self.last_name), start=start_date, end=end_date) #Subject Appointments old_events = Q(date_when__gt=start_date) & Q(date_when__gt=end_date) diff --git a/smash/web/officeAvailability.py b/smash/web/officeAvailability.py index de883fca4d884db0d3b0651991d1725aa5a23e7e..355c728ca89b9122c8c2d90846977e362bcab543 100644 --- a/smash/web/officeAvailability.py +++ b/smash/web/officeAvailability.py @@ -44,7 +44,7 @@ class OfficeAvailability(object): self.office_end = office_end self.minimum_slot = minimum_slot self.range = pd.date_range(start=self.start, end=self.end, freq=self.minimum_slot) - logger.debug(u'Name: {}. Min index: {}. Max index: {}'.format(self.name, self.start, self.end)) + logger.debug('Name: {}. Min index: {}. Max index: {}'.format(self.name, self.start, self.end)) self.availability = pd.Series(index=self.range, data=0) # initialize range at 0 def _get_duration(self): diff --git a/smash/web/redcap_connector.py b/smash/web/redcap_connector.py index 298a7d6745bd8288fdc2fdb85aad5089dc17461b..602bf2a12dd6d89dee33bf0caed0666b0f704e7a 100644 --- a/smash/web/redcap_connector.py +++ b/smash/web/redcap_connector.py @@ -1,5 +1,5 @@ # coding=utf-8 -import cStringIO +import io import datetime import json import logging @@ -222,7 +222,7 @@ class RedcapConnector(object): for smasch_appointment in smasch_appointments: smasch_appointment.mark_as_finished() if smasch_appointment.visit.is_finished != True: - description = u'{} changed from "{}" to "{}"'.format('is_finished', + description = '{} changed from "{}" to "{}"'.format('is_finished', smasch_appointment.visit.is_finished, True) p = Provenance(modified_table=Visit._meta.db_table, @@ -303,7 +303,7 @@ class RedcapConnector(object): if len(changes) > 0: for field, new_value in changes: old_value = getattr(subject, field) - description = u'{} changed from "{}" to "{}"'.format(field, old_value, new_value) + description = '{} changed from "{}" to "{}"'.format(field, old_value, new_value) p = Provenance(modified_table=StudySubject._meta.db_table, modified_table_id=subject.id, modification_author=self.importer_user, @@ -378,7 +378,7 @@ class RedcapConnector(object): fields = [] # get fields which are true from redcap columns - fields_to_check = [k for k, v in model_to_dict(study_subject.study.redcap_columns).iteritems() if v is True] + fields_to_check = [k for k, v in model_to_dict(study_subject.study.redcap_columns).items() if v is True] for field_to_check in fields_to_check: field = field_checks[field_to_check](red_cap_subject, study_subject) @@ -553,11 +553,11 @@ class RedcapConnector(object): return language def execute_query(self, query_data, is_json=True): - buf = cStringIO.StringIO() + buf = io.StringIO() curl_connection = pycurl.Curl() curl_connection.setopt(pycurl.CAINFO, certifi.where()) curl_connection.setopt(curl_connection.URL, self.base_url + "/api/") - curl_connection.setopt(curl_connection.HTTPPOST, query_data.items()) + curl_connection.setopt(curl_connection.HTTPPOST, list(query_data.items())) curl_connection.setopt(curl_connection.WRITEFUNCTION, buf.write) curl_connection.perform() curl_connection.close() diff --git a/smash/web/statistics.py b/smash/web/statistics.py index f94df0a8a5c6a318c0b4f6ee6bb766732201d722..596ae151c19652516717e9b635bff536e4b73f13 100644 --- a/smash/web/statistics.py +++ b/smash/web/statistics.py @@ -109,7 +109,7 @@ class StatisticsManager(object): self.statuses_list, visit, year, subject_type) results["appointments"] = results_appointments results["statuses_list"] = self.statuses_labels - appointment_types_values = map(attrgetter('code'), self.appointment_types.values()) + appointment_types_values = list(map(attrgetter('code'), list(self.appointment_types.values()))) sorted_appointment_types_values = sorted(appointment_types_values) results["appointments_types_list"] = sorted_appointment_types_values return results @@ -118,7 +118,7 @@ class StatisticsManager(object): subject_type=None): if not visit: results_appointments = {} - for appointment_type in self.appointment_types.values(): + for appointment_type in list(self.appointment_types.values()): appointment_type_filters = copy.deepcopy(filters_month_year_appointments) appointment_type_filters.add(Q(appointment_types=appointment_type), Q.AND) results_appointment_set = Appointment.objects.filter(appointment_type_filters).values( @@ -145,7 +145,7 @@ class StatisticsManager(object): appointment_type_id, status, count = row results_appointment_set[appointment_type_id][status] = int(count) results_appointments = {} - for appointment_type in self.appointment_types.values(): + for appointment_type in list(self.appointment_types.values()): if appointment_type.id not in results_appointment_set: results_appointments[appointment_type.code] = [0 * i for i in range(0, len(statuses_list) + 1)] continue diff --git a/smash/web/templatetags/filters.py b/smash/web/templatetags/filters.py index 218e34bc50f142b794a28ba7cf932b9de12c600a..a7a63383cf825187fbac57307b97da48f68a0da0 100644 --- a/smash/web/templatetags/filters.py +++ b/smash/web/templatetags/filters.py @@ -6,6 +6,7 @@ import datetime from web.models import ConfigurationItem from web.models.constants import VISIT_SHOW_VISIT_NUMBER_FROM_ZERO from distutils.util import strtobool +from functools import reduce register = template.Library() @@ -19,7 +20,7 @@ def add_class(value, arg): arg = 'checkbox' css_classes = value.field.widget.attrs.get('class', ' ').split(' ') # Filter out zero-length class names ('') - css_classes = filter(lambda x: len(x) > 0, css_classes) + css_classes = [x for x in css_classes if len(x) > 0] # Convert list to string css_classes = reduce(lambda a, x: "%s %s" % (a, x), css_classes, "") css_classes = '%s %s' % (css_classes, arg) diff --git a/smash/web/tests/__init__.py b/smash/web/tests/__init__.py index 1b351ebb9b61696606c63b71921ce5b46e6600fe..915d82c0bd85fec22b86d0d5f64c16e9f10fd818 100644 --- a/smash/web/tests/__init__.py +++ b/smash/web/tests/__init__.py @@ -7,7 +7,7 @@ from django.test import TestCase from web.models import Worker from web.decorators import PermissionDecorator -from functions import create_worker, create_user, add_permissions_to_worker +from .functions import create_worker, create_user, add_permissions_to_worker settings.MEDIA_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data') diff --git a/smash/web/tests/forms/test_AppointmentAddForm.py b/smash/web/tests/forms/test_AppointmentAddForm.py index d1f507ec58cc7d98c80fef696715403948b42d9f..388aa809dca799f1aa9d495f5c5f1084069da9c6 100644 --- a/smash/web/tests/forms/test_AppointmentAddForm.py +++ b/smash/web/tests/forms/test_AppointmentAddForm.py @@ -22,7 +22,7 @@ class AppointmentAddFormTests(TestCase): 'length': '50', 'visit': self.visit.id, 'location': location.id, - 'comment': u'A unicode comment with weird letters such as á è ü ñ ô', + 'comment': 'A unicode comment with weird letters such as á è ü ñ ô', 'datetime_when': "2020-01-01", } diff --git a/smash/web/tests/forms/test_AppointmentEditForm.py b/smash/web/tests/forms/test_AppointmentEditForm.py index a279e8bfb8c4f877cb78b6012d27853ef6213a2d..5565e1f3288d613d24df2b559541db5f5e13f1a1 100644 --- a/smash/web/tests/forms/test_AppointmentEditForm.py +++ b/smash/web/tests/forms/test_AppointmentEditForm.py @@ -20,7 +20,7 @@ class AppointmentEditFormTests(TestCase): self.sample_data = {'first_name': 'name', 'length': '50', 'location': location.id, - 'comment': u'A unicode comment with weird letters such as á è ü ñ ô', + 'comment': 'A unicode comment with weird letters such as á è ü ñ ô', 'datetime_when': "2020-01-01", } self.sample_data_with_status = self.sample_data diff --git a/smash/web/tests/forms/test_VisitAddForm.py b/smash/web/tests/forms/test_VisitAddForm.py index 14fbed837708331b331bdaf415d859ce9a13ca7b..62f7311bbd41f3855ceb5a87eef5210e1896088b 100644 --- a/smash/web/tests/forms/test_VisitAddForm.py +++ b/smash/web/tests/forms/test_VisitAddForm.py @@ -1,4 +1,4 @@ -from __future__ import print_function + from django.test import TestCase diff --git a/smash/web/tests/forms/test_voucher_forms.py b/smash/web/tests/forms/test_voucher_forms.py index 42a800080be3ad89dd84728214e86597b70367ad..62c6b1438fcd5943fc9f080997a9ddc86cbcfa59 100644 --- a/smash/web/tests/forms/test_voucher_forms.py +++ b/smash/web/tests/forms/test_voucher_forms.py @@ -34,7 +34,7 @@ class VoucherFormTests(LoggedInWithWorkerTestCase): "hours": 10, "voucher_type": voucher_type.id } - for key, value in voucher_form.initial.items(): + for key, value in list(voucher_form.initial.items()): form_data[key] = format_form_field(value) url = reverse('web.views.voucher_add') + '?study_subject_id=' + str(study_subject.id) @@ -62,6 +62,6 @@ class VoucherFormTests(LoggedInWithWorkerTestCase): def get_voucher_form_data(voucher): voucher_form = VoucherForm(instance=voucher) form_data = {} - for key, value in voucher_form.initial.items(): + for key, value in list(voucher_form.initial.items()): form_data[key] = format_form_field(value) return form_data diff --git a/smash/web/tests/importer/test_importer.py b/smash/web/tests/importer/test_importer.py index 602a5f299970826d89558c611e935914577d7a7e..9e94d688bee623226a751525824b5572af2fd9ec 100644 --- a/smash/web/tests/importer/test_importer.py +++ b/smash/web/tests/importer/test_importer.py @@ -5,7 +5,7 @@ import logging from django.test import TestCase -from mock_reader import MockReader +from .mock_reader import MockReader from web.tests.functions import create_study_subject from web.importer import Importer from web.models import Subject, StudySubject, Study, Provenance @@ -105,7 +105,7 @@ class TestImporter(TestCase): self.assertEqual(0, importer.warning_count) existing_study_subject = StudySubject.objects.filter(id=existing_study_subject.id)[0] - self.assertEquals(existing_study_subject.subject.first_name, subject.first_name) - self.assertEquals(existing_study_subject.subject.last_name, subject.last_name) - self.assertEquals(existing_study_subject.subject.date_born.strftime("%Y-%m-%d"), + self.assertEqual(existing_study_subject.subject.first_name, subject.first_name) + self.assertEqual(existing_study_subject.subject.last_name, subject.last_name) + self.assertEqual(existing_study_subject.subject.date_born.strftime("%Y-%m-%d"), subject.date_born.strftime("%Y-%m-%d")) diff --git a/smash/web/tests/importer/test_tns_csv_visit_import_reader.py b/smash/web/tests/importer/test_tns_csv_visit_import_reader.py index c154055775a70a2c50451d482cbceaa5eb42fa28..24be480239b0b8aecad4299bfc3888e11f443bde 100644 --- a/smash/web/tests/importer/test_tns_csv_visit_import_reader.py +++ b/smash/web/tests/importer/test_tns_csv_visit_import_reader.py @@ -25,9 +25,9 @@ class TestTnsCsvVisitReader(TestCase): create_study_subject(nd_number='cov-222333') create_study_subject(nd_number='cov-444444') - create_location(name=u"Laboratoires réunis 23 Route de Diekirch 6555 Bollendorf-Pont") - create_location(name=u"PickenDoheem") - create_location(name=u"Ketterthill 1-3, rue de la Continentale 4917 Bascharage") + create_location(name="Laboratoires réunis 23 Route de Diekirch 6555 Bollendorf-Pont") + create_location(name="PickenDoheem") + create_location(name="Ketterthill 1-3, rue de la Continentale 4917 Bascharage") def tearDown(self): setattr(settings, "IMPORT_APPOINTMENT_TYPE", None) @@ -42,14 +42,14 @@ class TestTnsCsvVisitReader(TestCase): self.assertEqual(1, visit.visit_number) appointment = Appointment.objects.filter(visit=visit)[0] - self.assertEqual(u"Laboratoires réunis 23 Route de Diekirch 6555 Bollendorf-Pont", + self.assertEqual("Laboratoires réunis 23 Route de Diekirch 6555 Bollendorf-Pont", appointment.location.name) self.assertEqual(10, appointment.datetime_when.day) self.assertEqual(4, appointment.datetime_when.month) self.assertEqual(2020, appointment.datetime_when.year) - self.assertEquals(0, self.get_warnings_count()) + self.assertEqual(0, self.get_warnings_count()) def test_load_data_with_existing_visit(self): filename = get_resource_path('tns_vouchers_import.csv') @@ -62,14 +62,14 @@ class TestTnsCsvVisitReader(TestCase): self.assertEqual("cov-000111", visit.subject.nd_number) appointment = Appointment.objects.filter(visit=visit)[0] - self.assertEqual(u"Laboratoires réunis 23 Route de Diekirch 6555 Bollendorf-Pont", + self.assertEqual("Laboratoires réunis 23 Route de Diekirch 6555 Bollendorf-Pont", appointment.location.name) self.assertEqual(10, appointment.datetime_when.day) self.assertEqual(4, appointment.datetime_when.month) self.assertEqual(2020, appointment.datetime_when.year) - self.assertEquals(0, self.get_warnings_count()) + self.assertEqual(0, self.get_warnings_count()) def test_load_data_with_existing_visit_and_appointment(self): filename = get_resource_path('tns_vouchers_import.csv') @@ -87,17 +87,17 @@ class TestTnsCsvVisitReader(TestCase): visit = Visit.objects.filter(id=visits[0].id)[0] self.assertEqual("cov-000111", visit.subject.nd_number) - self.assertEquals(1, Appointment.objects.filter(visit=visit).count()) + self.assertEqual(1, Appointment.objects.filter(visit=visit).count()) appointment = Appointment.objects.filter(visit=visit)[0] - self.assertEqual(u"Laboratoires réunis 23 Route de Diekirch 6555 Bollendorf-Pont", + self.assertEqual("Laboratoires réunis 23 Route de Diekirch 6555 Bollendorf-Pont", appointment.location.name) self.assertEqual(10, appointment.datetime_when.day) self.assertEqual(4, appointment.datetime_when.month) self.assertEqual(2020, appointment.datetime_when.year) - self.assertEquals(0, self.get_warnings_count()) + self.assertEqual(0, self.get_warnings_count()) def test_load_data_with_visit_and_no_previous_visits(self): filename = get_resource_path('tns_vouchers_3_import.csv') @@ -106,20 +106,20 @@ class TestTnsCsvVisitReader(TestCase): subject_visits = Visit.objects.filter(subject=StudySubject.objects.filter(nd_number='cov-000111')[0]) - self.assertEquals(3, len(subject_visits)) + self.assertEqual(3, len(subject_visits)) visit = Visit.objects.filter(id=visits[0].id)[0] self.assertEqual("cov-000111", visit.subject.nd_number) appointment = Appointment.objects.filter(visit=visit)[0] - self.assertEqual(u"Laboratoires réunis 23 Route de Diekirch 6555 Bollendorf-Pont", + self.assertEqual("Laboratoires réunis 23 Route de Diekirch 6555 Bollendorf-Pont", appointment.location.name) self.assertEqual(10, appointment.datetime_when.day) self.assertEqual(4, appointment.datetime_when.month) self.assertEqual(2020, appointment.datetime_when.year) - self.assertEquals(2, self.get_warnings_count()) + self.assertEqual(2, self.get_warnings_count()) def test_load_data_with_no_subject(self): filename = get_resource_path('tns_vouchers_import.csv') @@ -130,7 +130,7 @@ class TestTnsCsvVisitReader(TestCase): self.assertEqual("cov-000111", visit.subject.nd_number) self.assertEqual(1, visit.visit_number) - self.assertEquals(0, self.get_warnings_count()) + self.assertEqual(0, self.get_warnings_count()) def test_load_data_with_lab_id(self): filename = get_resource_path('tns_vouchers_lab_id_import.csv') @@ -139,17 +139,17 @@ class TestTnsCsvVisitReader(TestCase): visit = Visit.objects.filter(id=visits[0].id)[0] appointment = Appointment.objects.filter(visit=visit)[0] - self.assertTrue(u"Laboratoires réunis" in appointment.location.name) + self.assertTrue("Laboratoires réunis" in appointment.location.name) visit = Visit.objects.filter(id=visits[1].id)[0] appointment = Appointment.objects.filter(visit=visit)[0] - self.assertTrue(u"Ketterthill" in appointment.location.name) + self.assertTrue("Ketterthill" in appointment.location.name) visit = Visit.objects.filter(id=visits[2].id)[0] appointment = Appointment.objects.filter(visit=visit)[0] - self.assertTrue(u"BioneXt" in appointment.location.name) + self.assertTrue("BioneXt" in appointment.location.name) - self.assertEquals(3, self.get_warnings_count()) + self.assertEqual(3, self.get_warnings_count()) def test_dont_add_links_for_existing_appointments(self): filename = get_resource_path('tns_vouchers_import.csv') @@ -157,9 +157,9 @@ class TestTnsCsvVisitReader(TestCase): links = AppointmentTypeLink.objects.all().count() TnsCsvVisitImportReader().load_data(filename) - self.assertEquals(links, AppointmentTypeLink.objects.all().count()) + self.assertEqual(links, AppointmentTypeLink.objects.all().count()) - self.assertEquals(0, self.get_warnings_count()) + self.assertEqual(0, self.get_warnings_count()) def get_warnings_count(self): if "WARNING" in self.warning_counter.level2count: diff --git a/smash/web/tests/models/test_availability.py b/smash/web/tests/models/test_availability.py index a423e1a80f3d7bb7c39a957b1c8d58230a895c64..07b17b856941e784e714e2fdeeb37da9faeb6870 100644 --- a/smash/web/tests/models/test_availability.py +++ b/smash/web/tests/models/test_availability.py @@ -14,4 +14,4 @@ class AvailabilityTests(TestCase): availability = Availability(person=create_worker(), day_number=MONDAY_AS_DAY_OF_WEEK) self.assertTrue("MONDAY" in str(availability)) - self.assertTrue("MONDAY" in unicode(availability)) + self.assertTrue("MONDAY" in str(availability)) diff --git a/smash/web/tests/models/test_configuration_item.py b/smash/web/tests/models/test_configuration_item.py index d5474038c8e7ba9c6d8d5256f148846f61dfa5b8..9ece6297d58fce3f9c56139022c16383e0b9e35c 100644 --- a/smash/web/tests/models/test_configuration_item.py +++ b/smash/web/tests/models/test_configuration_item.py @@ -19,7 +19,7 @@ class ConfigurationItemModelTests(TestCase): configuration_item = create_configuration_item() self.assertIsNotNone(str(configuration_item)) - self.assertIsNotNone(unicode(configuration_item)) + self.assertIsNotNone(str(configuration_item)) def test_validate(self): item = ConfigurationItem.objects.filter(type=KIT_EMAIL_HOUR_CONFIGURATION_TYPE)[0] diff --git a/smash/web/tests/models/test_contact_attempt.py b/smash/web/tests/models/test_contact_attempt.py index 504cdb6a2b5758af524497d503050a3083147783..4da9b6ba55d11483b6c55b62a813c1a856345071 100644 --- a/smash/web/tests/models/test_contact_attempt.py +++ b/smash/web/tests/models/test_contact_attempt.py @@ -14,4 +14,4 @@ class ContactAttemptTests(TestCase): contact_attempt = ContactAttempt(worker=create_worker(), subject=create_study_subject()) self.assertIsNotNone(str(contact_attempt)) - self.assertIsNotNone(unicode(contact_attempt)) + self.assertIsNotNone(str(contact_attempt)) diff --git a/smash/web/tests/models/test_holiday.py b/smash/web/tests/models/test_holiday.py index 73fcbb256b00c575fe7373ab3c267b8eee460224..23000deb0b6b61d5b6bccbb50c180604731e5da0 100644 --- a/smash/web/tests/models/test_holiday.py +++ b/smash/web/tests/models/test_holiday.py @@ -13,4 +13,4 @@ class HolidayTests(TestCase): holiday = Holiday(person=create_worker()) self.assertIsNotNone(str(holiday)) - self.assertIsNotNone(unicode(holiday)) + self.assertIsNotNone(str(holiday)) diff --git a/smash/web/tests/models/test_inconsistent_subject.py b/smash/web/tests/models/test_inconsistent_subject.py index 1ee33c4e38a2e1ef0706fd3f5b2864758413251d..000cf6ac1f083941c8eba6e125f24ce68d33069e 100644 --- a/smash/web/tests/models/test_inconsistent_subject.py +++ b/smash/web/tests/models/test_inconsistent_subject.py @@ -9,11 +9,11 @@ class InconsistentSubjectTests(TestCase): subject = create_study_subject() inconsistent_subject = InconsistentSubject.create(subject) self.assertIsNotNone(str(inconsistent_subject)) - self.assertIsNotNone(unicode(inconsistent_subject)) + self.assertIsNotNone(str(inconsistent_subject)) class InconsistentFieldTests(TestCase): def test_create_with_empty_data(self): inconsistent_field = InconsistentField.create("field name", None, None) self.assertIsNotNone(str(inconsistent_field)) - self.assertIsNotNone(unicode(inconsistent_field)) + self.assertIsNotNone(str(inconsistent_field)) diff --git a/smash/web/tests/models/test_item.py b/smash/web/tests/models/test_item.py index a3d53bd92392075d80114f012786eee7dc0b2bd1..41cf2cb84b27637ccf00e1c2145edb72627ff7b6 100644 --- a/smash/web/tests/models/test_item.py +++ b/smash/web/tests/models/test_item.py @@ -12,4 +12,4 @@ class ItemTests(TestCase): item = Item(name="test item") self.assertIsNotNone(str(item)) - self.assertIsNotNone(unicode(item)) + self.assertIsNotNone(str(item)) diff --git a/smash/web/tests/models/test_mail_template.py b/smash/web/tests/models/test_mail_template.py index 6aaded5be31542aab93fdfd6c00baec1ab779bd1..73c795bfddc6e513d34c2cb0086dc3480d78349a 100644 --- a/smash/web/tests/models/test_mail_template.py +++ b/smash/web/tests/models/test_mail_template.py @@ -1,5 +1,5 @@ # coding=utf-8 -import StringIO +import io from django.test import TestCase from docx import Document @@ -78,7 +78,7 @@ class MailTemplateModelTests(TestCase): appointment_template_french = MailTemplate(name=template_name_french, language=self.french_language, context=MAIL_TEMPLATE_CONTEXT_APPOINTMENT, template_file=self.template_file) - stream = StringIO.StringIO() + stream = io.StringIO() appointment_template_french.apply(appointment, self.user, stream) doc = Document(stream) worker_name = str(self.user.worker) @@ -89,12 +89,12 @@ class MailTemplateModelTests(TestCase): template_name_french = "test_fr" appointment = create_appointment() # noinspection PyNonAsciiChar - flying_team_name = u"Liège" + flying_team_name = "Liège" appointment.flying_team = create_flying_team(flying_team_name) appointment_template_french = MailTemplate(name=template_name_french, language=self.french_language, context=MAIL_TEMPLATE_CONTEXT_APPOINTMENT, template_file=self.template_file) - stream = StringIO.StringIO() + stream = io.StringIO() appointment_template_french.apply(appointment, self.user, stream) doc = Document(stream) self.check_doc_contains(doc, [flying_team_name]) @@ -105,7 +105,7 @@ class MailTemplateModelTests(TestCase): subject_template_french = MailTemplate(name=template_name_french, language=self.french_language, context=MAIL_TEMPLATE_CONTEXT_SUBJECT, template_file=self.template_file) - stream = StringIO.StringIO() + stream = io.StringIO() subject_template_french.apply(subject, self.user, stream) doc = Document(stream) worker_name = str(self.user.worker) @@ -120,7 +120,7 @@ class MailTemplateModelTests(TestCase): context=MAIL_TEMPLATE_CONTEXT_VOUCHER, template_file="voucher_test.docx") voucher = create_voucher(study_subject=subject) - stream = StringIO.StringIO() + stream = io.StringIO() subject_template_french.apply(voucher, self.user, stream) doc = Document(stream) worker_name = str(self.user.worker) @@ -137,7 +137,7 @@ class MailTemplateModelTests(TestCase): context=MAIL_TEMPLATE_CONTEXT_VOUCHER, template_file="template_with_tables.docx") voucher = create_voucher(study_subject=subject) - stream = StringIO.StringIO() + stream = io.StringIO() subject_template_french.apply(voucher, self.user, stream) doc = Document(stream) worker_name = str(self.user.worker) @@ -199,11 +199,11 @@ class MailTemplateModelTests(TestCase): template_file="voucher_test.docx").save() templates = MailTemplate.get_mail_templates_for_context([], context=MAIL_TEMPLATE_CONTEXT_VOUCHER) - self.assertEquals(1, len(templates[0])) + self.assertEqual(1, len(templates[0])) templates = MailTemplate.get_mail_templates_for_context([self.english_language], context=MAIL_TEMPLATE_CONTEXT_VOUCHER) - self.assertEquals(0, len(templates[0])) + self.assertEqual(0, len(templates[0])) def test_get_mail_templates_for_context_without_language_2(self): template_name_french = "test_without_language" @@ -212,7 +212,7 @@ class MailTemplateModelTests(TestCase): template_file="voucher_test.docx").save() templates = MailTemplate.get_mail_templates_for_context([], context=MAIL_TEMPLATE_CONTEXT_VOUCHER) - self.assertEquals(0, len(templates[0])) + self.assertEqual(0, len(templates[0])) def test_apply_visit(self): template_name_french = "test_fr" @@ -220,7 +220,7 @@ class MailTemplateModelTests(TestCase): visit_template_french = MailTemplate(name=template_name_french, language=self.french_language, context=MAIL_TEMPLATE_CONTEXT_VISIT, template_file=self.template_file) - stream = StringIO.StringIO() + stream = io.StringIO() visit_template_french.apply(visit, self.user, stream) doc = Document(stream) worker_name = str(self.user.worker) @@ -255,4 +255,4 @@ class MailTemplateModelTests(TestCase): def test_get_generic_replacements(self): worker = create_worker() result = MailTemplate.get_generic_replacements(worker) - self.assertEquals(result['##WORKER_EMAIL##'], worker.email) + self.assertEqual(result['##WORKER_EMAIL##'], worker.email) diff --git a/smash/web/tests/models/test_missing_subject.py b/smash/web/tests/models/test_missing_subject.py index 712969a9b125ca8b4e7a6c80ed735aac3f601fa0..ed8c792eeeb27f346d0721083b5769e6be6a8db1 100644 --- a/smash/web/tests/models/test_missing_subject.py +++ b/smash/web/tests/models/test_missing_subject.py @@ -9,11 +9,11 @@ class MissingSubjectTests(TestCase): subject = create_study_subject() missing_subject = MissingSubject.create(red_cap_subject=None, smash_subject=subject) self.assertIsNotNone(str(missing_subject)) - self.assertIsNotNone(unicode(missing_subject)) + self.assertIsNotNone(str(missing_subject)) def test_create_with_empty_smash_subject(self): red_cap_subject = create_red_cap_subject() missing_subject = MissingSubject.create(red_cap_subject=red_cap_subject, smash_subject=None) self.assertIsNotNone(str(missing_subject)) - self.assertIsNotNone(unicode(missing_subject)) + self.assertIsNotNone(str(missing_subject)) diff --git a/smash/web/tests/models/test_room.py b/smash/web/tests/models/test_room.py index 470aed6add037491ccfd56549510d6255fceb7df..56e9a3cc2526c9da42e11400c8787af65b0315f5 100644 --- a/smash/web/tests/models/test_room.py +++ b/smash/web/tests/models/test_room.py @@ -12,4 +12,4 @@ class RoomTests(TestCase): room = Room(room_number=4, address="some street 2/3", city="Luxembourg") self.assertIsNotNone(str(room)) - self.assertIsNotNone(unicode(room)) + self.assertIsNotNone(str(room)) diff --git a/smash/web/tests/models/test_study_subject.py b/smash/web/tests/models/test_study_subject.py index 38fe23a335c6d210509c52bd5feae4e387c41ceb..343aa758cfaabb4bd57fd67f60322fe1d53af74b 100644 --- a/smash/web/tests/models/test_study_subject.py +++ b/smash/web/tests/models/test_study_subject.py @@ -22,7 +22,7 @@ class SubjectModelTests(TestCase): self.assertTrue(subject.endpoint_reached) self.assertTrue(visit_finished) - self.assertEquals( + self.assertEqual( Appointment.APPOINTMENT_STATUS_CANCELLED, appointment_status) def test_mark_as_endpoint_reached(self): @@ -37,7 +37,7 @@ class SubjectModelTests(TestCase): self.assertTrue(subject.endpoint_reached) self.assertTrue(visit_finished) - self.assertEquals( + self.assertEqual( Appointment.APPOINTMENT_STATUS_CANCELLED, appointment_status) def test_signal_mark_as_resigned(self): @@ -53,7 +53,7 @@ class SubjectModelTests(TestCase): self.assertTrue(subject.resigned) self.assertTrue(visit_finished) - self.assertEquals( + self.assertEqual( Appointment.APPOINTMENT_STATUS_CANCELLED, appointment_status) def test_mark_as_resigned(self): @@ -68,7 +68,7 @@ class SubjectModelTests(TestCase): self.assertTrue(subject.resigned) self.assertTrue(visit_finished) - self.assertEquals( + self.assertEqual( Appointment.APPOINTMENT_STATUS_CANCELLED, appointment_status) def test_signal_mark_as_excluded(self): @@ -84,7 +84,7 @@ class SubjectModelTests(TestCase): self.assertTrue(subject.excluded) self.assertTrue(visit_finished) - self.assertEquals( + self.assertEqual( Appointment.APPOINTMENT_STATUS_CANCELLED, appointment_status) def test_mark_as_excluded(self): @@ -99,7 +99,7 @@ class SubjectModelTests(TestCase): self.assertTrue(subject.excluded) self.assertTrue(visit_finished) - self.assertEquals( + self.assertEqual( Appointment.APPOINTMENT_STATUS_CANCELLED, appointment_status) def test_check_nd_number_regex(self): diff --git a/smash/web/tests/models/test_subject.py b/smash/web/tests/models/test_subject.py index 66c4ffbd0b91f888a38a0588e28ba970b57b6886..092d7fee8ef327f1fdc53008487a816f9b9dd4a0 100644 --- a/smash/web/tests/models/test_subject.py +++ b/smash/web/tests/models/test_subject.py @@ -18,7 +18,7 @@ class SubjectModelTests(TestCase): self.assertTrue(subject.dead) self.assertTrue(visit_finished) - self.assertEquals(Appointment.APPOINTMENT_STATUS_CANCELLED, appointment_status) + self.assertEqual(Appointment.APPOINTMENT_STATUS_CANCELLED, appointment_status) def test_mark_as_dead(self): study_subject = create_study_subject() @@ -32,10 +32,10 @@ class SubjectModelTests(TestCase): self.assertTrue(subject.dead) self.assertTrue(visit_finished) - self.assertEquals(Appointment.APPOINTMENT_STATUS_CANCELLED, appointment_status) + self.assertEqual(Appointment.APPOINTMENT_STATUS_CANCELLED, appointment_status) def test_str(self): subject = create_subject() self.assertIsNotNone(str(subject)) - self.assertIsNotNone(unicode(subject)) + self.assertIsNotNone(str(subject)) diff --git a/smash/web/tests/models/test_visit.py b/smash/web/tests/models/test_visit.py index 63a022d69ccd6d702325c2080ad953a627446c35..e02273f887262b86c5e88869333d60792219d5a5 100644 --- a/smash/web/tests/models/test_visit.py +++ b/smash/web/tests/models/test_visit.py @@ -17,12 +17,12 @@ class VisitModelTests(TestCase): visit1 = create_visit(subject=subject) visit1.datetime_end = get_today_midnight_date() + datetime.timedelta(days=1) visit1.save() - self.assertEquals(1, visit1.visit_number) + self.assertEqual(1, visit1.visit_number) visit2 = create_visit(subject=subject) visit2.datetime_end = get_today_midnight_date() + datetime.timedelta(days=2) visit2.save() visit2.refresh_from_db() - self.assertEquals(2, visit2.visit_number) + self.assertEqual(2, visit2.visit_number) def test_socalled_concurrency(self): subject = create_study_subject() @@ -38,8 +38,8 @@ class VisitModelTests(TestCase): visit1.refresh_from_db() visit2.refresh_from_db() - self.assertEquals(1, visit1.visit_number) - self.assertEquals(2, visit2.visit_number) + self.assertEqual(1, visit1.visit_number) + self.assertEqual(2, visit2.visit_number) datetime_begin = get_today_midnight_date() - datetime.timedelta(days=60) datetime_end = get_today_midnight_date() - datetime.timedelta(days=55) @@ -47,9 +47,9 @@ class VisitModelTests(TestCase): visit1.refresh_from_db() visit2.refresh_from_db() visit3.refresh_from_db() - self.assertEquals(1, visit3.visit_number) - self.assertEquals(2, visit1.visit_number) - self.assertEquals(3, visit2.visit_number) + self.assertEqual(1, visit3.visit_number) + self.assertEqual(2, visit1.visit_number) + self.assertEqual(3, visit2.visit_number) def test_visit_numbers(self): subject = create_study_subject() @@ -68,9 +68,9 @@ class VisitModelTests(TestCase): visit1.refresh_from_db() visit2.refresh_from_db() visit3.refresh_from_db() - self.assertEquals(1, visit1.visit_number) - self.assertEquals(2, visit2.visit_number) - self.assertEquals(3, visit3.visit_number) + self.assertEqual(1, visit1.visit_number) + self.assertEqual(2, visit2.visit_number) + self.assertEqual(3, visit3.visit_number) #NOW, move V3 between V1 and V2 visit3.datetime_begin = get_today_midnight_date() - datetime.timedelta(days=11) @@ -81,9 +81,9 @@ class VisitModelTests(TestCase): visit1.refresh_from_db() visit2.refresh_from_db() visit3.refresh_from_db() - self.assertEquals(1, visit1.visit_number) - self.assertEquals(3, visit2.visit_number) #<= change - self.assertEquals(2, visit3.visit_number) #<= change + self.assertEqual(1, visit1.visit_number) + self.assertEqual(3, visit2.visit_number) #<= change + self.assertEqual(2, visit3.visit_number) #<= change #NOW, move V1 after V2 and V3 visit1.datetime_begin = get_today_midnight_date() + datetime.timedelta(days=110) @@ -94,9 +94,9 @@ class VisitModelTests(TestCase): visit1.refresh_from_db() visit2.refresh_from_db() visit3.refresh_from_db() - self.assertEquals(3, visit1.visit_number) #<= change - self.assertEquals(2, visit2.visit_number) #<= change - self.assertEquals(1, visit3.visit_number) #<= change + self.assertEqual(3, visit1.visit_number) #<= change + self.assertEqual(2, visit2.visit_number) #<= change + self.assertEqual(1, visit3.visit_number) #<= change def test_mark_as_finished(self): subject = create_study_subject() @@ -105,7 +105,7 @@ class VisitModelTests(TestCase): visit.mark_as_finished() visit_count = Visit.objects.filter(subject=subject).count() - self.assertEquals(2, visit_count) + self.assertEqual(2, visit_count) def test_mark_as_finished_2(self): study_subject = create_study_subject() @@ -116,7 +116,7 @@ class VisitModelTests(TestCase): visit.mark_as_finished() visit_count = Visit.objects.filter(subject=study_subject).count() - self.assertEquals(1, visit_count) + self.assertEqual(1, visit_count) def test_mark_as_finished_3(self): subject = create_study_subject() @@ -127,7 +127,7 @@ class VisitModelTests(TestCase): visit.mark_as_finished() visit_count = Visit.objects.filter(subject=subject).count() - self.assertEquals(1, visit_count) + self.assertEqual(1, visit_count) def test_mark_as_finished_4(self): subject = create_study_subject() @@ -138,7 +138,7 @@ class VisitModelTests(TestCase): visit.mark_as_finished() visit_count = Visit.objects.filter(subject=subject).count() - self.assertEquals(1, visit_count) + self.assertEqual(1, visit_count) def test_mark_as_finished_for_follow_up_visit(self): subject = create_study_subject() @@ -157,7 +157,7 @@ class VisitModelTests(TestCase): follow_up_visit.mark_as_finished() visit_count = Visit.objects.filter(subject=subject).count() - self.assertEquals(3, visit_count) + self.assertEqual(3, visit_count) visit_number=3 new_follow_up = Visit.objects.filter(subject=subject).filter(visit_number=visit_number)[0] @@ -176,4 +176,4 @@ class VisitModelTests(TestCase): def test_visit_to_unicode(self): visit = create_visit(create_study_subject()) - self.assertIsNotNone(unicode(visit)) + self.assertIsNotNone(str(visit)) diff --git a/smash/web/tests/models/test_voucher.py b/smash/web/tests/models/test_voucher.py index ec5e94316c2bda04dd70bb337498063ff4decca8..dd44146f32ceda27e098916528373b8f113acb22 100644 --- a/smash/web/tests/models/test_voucher.py +++ b/smash/web/tests/models/test_voucher.py @@ -12,4 +12,4 @@ class VoucherTests(TestCase): voucher = create_voucher() self.assertTrue(voucher.number in str(voucher)) - self.assertTrue(voucher.number in unicode(voucher)) + self.assertTrue(voucher.number in str(voucher)) diff --git a/smash/web/tests/models/test_voucher_type.py b/smash/web/tests/models/test_voucher_type.py index 3c47e30bc18f79f2f41ae75cdb6fac9861b6a5f1..42f48d4d7f63aceb786294852df3af0e0c756325 100644 --- a/smash/web/tests/models/test_voucher_type.py +++ b/smash/web/tests/models/test_voucher_type.py @@ -12,4 +12,4 @@ class VoucherTypeTests(TestCase): voucher_type = create_voucher_type() self.assertTrue(voucher_type.code in str(voucher_type)) - self.assertTrue(voucher_type.code in unicode(voucher_type)) + self.assertTrue(voucher_type.code in str(voucher_type)) diff --git a/smash/web/tests/test_RedcapConnector.py b/smash/web/tests/test_RedcapConnector.py index fb539c990c624524e56eddfb2d5aed7d3c693f74..557ec07bffd3fc493a6319d07fb07debee37d79c 100644 --- a/smash/web/tests/test_RedcapConnector.py +++ b/smash/web/tests/test_RedcapConnector.py @@ -5,7 +5,7 @@ import unittest from django.test import TestCase -from functions import create_study_subject, prepare_test_redcap_connection +from .functions import create_study_subject, prepare_test_redcap_connection from web.models import Language from web.models.inconsistent_subject import InconsistentSubject from web.models.missing_subject import MissingSubject diff --git a/smash/web/tests/test_office_availability.py b/smash/web/tests/test_office_availability.py index 58652fbc2abf3b6fa34d5d15dbed90162b32cc08..37a375071f666c55a4293f6210357519845fb38e 100644 --- a/smash/web/tests/test_office_availability.py +++ b/smash/web/tests/test_office_availability.py @@ -6,7 +6,7 @@ from django.utils import timezone import datetime import pandas as pd from datetime import timedelta -from functions import create_availability, create_visit, create_appointment, create_appointment_type +from .functions import create_availability, create_visit, create_appointment, create_appointment_type from web.utils import get_weekdays_in_period from web.officeAvailability import OfficeAvailability from web.models.holiday import Holiday @@ -25,9 +25,9 @@ class OfficeAvailabilityTest(TestCase): start_date = datetime.datetime(today.year, today.month, today.day, tzinfo=today.tzinfo) #today midnight end_date = start_date + datetime.timedelta(days=1) - first_name = u'âêîôûŵŷäëïöüẅÿà ' - last_name = u'èìòùáºá»³Ã¡Ã©Ãóúẃýćńóśźżąę' - office_availability = OfficeAvailability(u'{} {}'.format(first_name, last_name), + first_name = 'âêîôûŵŷäëïöüẅÿà ' + last_name = 'èìòùáºá»³Ã¡Ã©Ãóúẃýćńóśźżąę' + office_availability = OfficeAvailability('{} {}'.format(first_name, last_name), start=start_date, end=end_date, office_start='8:00', office_end='18:00') #no availabilties added yet @@ -117,9 +117,9 @@ class OfficeAvailabilityTest(TestCase): start_date = datetime.datetime(today.year, today.month, today.day, tzinfo=today.tzinfo) #today midnight end_date = start_date + datetime.timedelta(days=1) - first_name = u'âêîôûŵŷäëïöüẅÿà ' - last_name = u'èìòùáºá»³Ã¡Ã©Ãóúẃýćńóśźżąę' - office_availability = OfficeAvailability(u'{} {}'.format(first_name, last_name), + first_name = 'âêîôûŵŷäëïöüẅÿà ' + last_name = 'èìòùáºá»³Ã¡Ã©Ãóúẃýćńóśźżąę' + office_availability = OfficeAvailability('{} {}'.format(first_name, last_name), start=start_date, end=end_date, office_start='8:00', office_end='18:00') #no availabilties added yet @@ -154,9 +154,9 @@ class OfficeAvailabilityTest(TestCase): start_date = datetime.datetime(today.year, today.month, today.day, tzinfo=today.tzinfo) #today midnight end_date = start_date + datetime.timedelta(days=1) - first_name = u'âêîôûŵŷäëïöüẅÿà ' - last_name = u'èìòùáºá»³Ã¡Ã©Ãóúẃýćńóśźżąę' - office_availability = OfficeAvailability(u'{} {}'.format(first_name, last_name), + first_name = 'âêîôûŵŷäëïöüẅÿà ' + last_name = 'èìòùáºá»³Ã¡Ã©Ãóúẃýćńóśźżąę' + office_availability = OfficeAvailability('{} {}'.format(first_name, last_name), start=start_date, end=end_date, office_start='8:00', office_end='18:00') #no availabilties added yet diff --git a/smash/web/tests/view/test_appointments.py b/smash/web/tests/view/test_appointments.py index 02b8f6ac99a44c87f17e493c4713c2a42ab072f5..96fb5ed08a0e1d008d6a68c6f7d5897730a5e14f 100644 --- a/smash/web/tests/view/test_appointments.py +++ b/smash/web/tests/view/test_appointments.py @@ -39,7 +39,7 @@ class AppointmentsViewTests(LoggedInTestCase): form_data['datetime_when'] = datetime.datetime.today() form_data['location'] = location.id form_data['length'] = 10 - form_data['comment'] = u'A comment with weird letters such as á è ü ñ ô' + form_data['comment'] = 'A comment with weird letters such as á è ü ñ ô' response = self.client.post(reverse('web.views.appointment_add_general'), data=form_data) self.assertEqual(response.status_code, 302) @@ -51,7 +51,7 @@ class AppointmentsViewTests(LoggedInTestCase): form_appointment = AppointmentAddForm(user=self.user) form_data['datetime_when'] = datetime.datetime.today() form_data['location'] = location.id - form_data['comment'] = u'A comment with weird letters such as á è ü ñ ô' + form_data['comment'] = 'A comment with weird letters such as á è ü ñ ô' form_data['length'] = 10 response = self.client.post(reverse('web.views.appointment_add', kwargs={'visit_id': visit.id}), data=form_data) @@ -65,7 +65,7 @@ class AppointmentsViewTests(LoggedInTestCase): subject = create_study_subject() visit = create_visit(subject) appointment = create_appointment(visit, when=datetime.datetime.now()) - new_comment = u'new unicode comment with accents à è ì ò ù' + new_comment = 'new unicode comment with accents à è ì ò ù' new_status = appointment.APPOINTMENT_STATUS_NO_SHOW new_last_name = "new last name" form_data = self.prepare_form(appointment, subject) @@ -115,7 +115,7 @@ class AppointmentsViewTests(LoggedInTestCase): form_appointment = AppointmentEditForm(user=self.user, instance=appointment, prefix="appointment") form_data = {} - for key, value in form_appointment.initial.items(): + for key, value in list(form_appointment.initial.items()): if value is not None: form_data['appointment-{}'.format(key)] = value response = self.client.post( @@ -130,7 +130,7 @@ class AppointmentsViewTests(LoggedInTestCase): form_appointment = AppointmentEditForm(user=self.user, instance=appointment, prefix="appointment") form_data = {} - for key, value in form_appointment.initial.items(): + for key, value in list(form_appointment.initial.items()): if value is not None: form_data['appointment-{}'.format(key)] = format_form_field(value) form_data['appointment-status'] = Appointment.APPOINTMENT_STATUS_FINISHED @@ -212,11 +212,11 @@ class AppointmentsViewTests(LoggedInTestCase): form_study_subject = StudySubjectEditForm(instance=subject, prefix="study-subject") form_subject = SubjectEditForm(instance=subject.subject, prefix="subject") form_data = {} - for key, value in form_appointment.initial.items(): + for key, value in list(form_appointment.initial.items()): form_data['appointment-{}'.format(key)] = format_form_field(value) - for key, value in form_study_subject.initial.items(): + for key, value in list(form_study_subject.initial.items()): form_data['study-subject-{}'.format(key)] = format_form_field(value) - for key, value in form_subject.initial.items(): + for key, value in list(form_subject.initial.items()): form_data['subject-{}'.format(key)] = format_form_field(value) form_data["study-subject-referral_letter"] = SimpleUploadedFile("file.txt", b"file_content") return form_data diff --git a/smash/web/tests/view/test_contact_attempt.py b/smash/web/tests/view/test_contact_attempt.py index 7800f189adf2554df05e35761c0a517b4229cfaa..7277674d49ef711de8c5afa49afc6e776ba1ac81 100644 --- a/smash/web/tests/view/test_contact_attempt.py +++ b/smash/web/tests/view/test_contact_attempt.py @@ -58,7 +58,7 @@ class ContactAttemptViewTests(LoggedInWithWorkerTestCase): form_subject = ContactAttemptEditForm(instance=contact_attempt, user=self.user) form_data = {} - for key, value in form_subject.initial.items(): + for key, value in list(form_subject.initial.items()): if value is not None: form_data[key] = format_form_field(value) diff --git a/smash/web/tests/view/test_functions.py b/smash/web/tests/view/test_functions.py index d03ab059ae136521a764883b443018f105fdc894..54df1e85613c1bbe0af3f017be7b34d5662acdfa 100644 --- a/smash/web/tests/view/test_functions.py +++ b/smash/web/tests/view/test_functions.py @@ -12,12 +12,12 @@ class ViewFunctionsTests(TestCase): def test_locations_for_user(self): user = create_user() - self.assertEquals(1, len(get_filter_locations(user))) + self.assertEqual(1, len(get_filter_locations(user))) def test_locations_for_worker(self): worker = create_worker() - self.assertEquals(1, len(get_filter_locations(worker))) + self.assertEqual(1, len(get_filter_locations(worker))) def test_locations_for_worker_with_location(self): worker = create_worker() @@ -25,4 +25,4 @@ class ViewFunctionsTests(TestCase): worker.save() create_location() - self.assertEquals(1, len(get_filter_locations(worker))) + self.assertEqual(1, len(get_filter_locations(worker))) diff --git a/smash/web/tests/view/test_notifications.py b/smash/web/tests/view/test_notifications.py index 5d4615a2e8dd1be0b68c9209f19a243a85b149cb..61c1860cdd01a423805f2b814ccbed91ff3aeef9 100644 --- a/smash/web/tests/view/test_notifications.py +++ b/smash/web/tests/view/test_notifications.py @@ -40,14 +40,14 @@ class NotificationViewTests(LoggedInTestCase): # first visit doesn't go to notifications notification = get_exceeded_visit_notifications_count(self.user) - self.assertEquals(original_notification.count, notification.count) + self.assertEqual(original_notification.count, notification.count) Visit.objects.create(datetime_begin="2012-01-01", datetime_end="2012-01-02", subject=subject) notification = get_exceeded_visit_notifications_count(self.user) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) def test_get_exceeded_visit_notifications_count_for_first_visit(self): subject = create_study_subject() @@ -58,7 +58,7 @@ class NotificationViewTests(LoggedInTestCase): appointment.status = Appointment.APPOINTMENT_STATUS_FINISHED appointment.save() notification = get_exceeded_visit_notifications_count(self.user) - self.assertEquals(1, notification.count) + self.assertEqual(1, notification.count) def test_get_exceeded_visit_notifications_count_2(self): original_notification = get_visits_without_appointments_count(self.user) @@ -71,7 +71,7 @@ class NotificationViewTests(LoggedInTestCase): create_appointment(visit) notification = get_exceeded_visit_notifications_count(self.user) - self.assertEquals(original_notification.count, notification.count) + self.assertEqual(original_notification.count, notification.count) def test_get_visits_without_appointments_count(self): original_notification = get_visits_without_appointments_count(self.user) @@ -79,7 +79,7 @@ class NotificationViewTests(LoggedInTestCase): create_visit(subject) notification = get_visits_without_appointments_count(self.user) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) def test_get_visits_with_missing_appointments_count(self): original_notification = get_visits_with_missing_appointments_count(self.user) @@ -90,7 +90,7 @@ class NotificationViewTests(LoggedInTestCase): visit.save() notification = get_visits_with_missing_appointments_count(self.user) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) def test_get_visits_with_missing_appointments_count_2(self): original_notification = get_visits_with_missing_appointments_count(self.user) @@ -106,13 +106,13 @@ class NotificationViewTests(LoggedInTestCase): appointment.save() notification = get_visits_with_missing_appointments_count(self.user) - self.assertEquals(original_notification.count, notification.count) + self.assertEqual(original_notification.count, notification.count) def test_get_notifications(self): create_worker(self.user) result = get_notifications(self.user) - self.assertEquals(0, result[0]) + self.assertEqual(0, result[0]) self.assertTrue(isinstance(result[1], list)) self.assertTrue(len(result[1]) > 0) @@ -124,8 +124,8 @@ class NotificationViewTests(LoggedInTestCase): create_worker(self.user) result = get_notifications(self.user) - self.assertEquals(0, result[0]) - self.assertEquals(0, len(result[1])) + self.assertEqual(0, result[0]) + self.assertEqual(0, len(result[1])) def test_get_notifications_with_full_study_notification(self): study = Study.objects.filter(id=GLOBAL_STUDY_ID)[0] @@ -135,7 +135,7 @@ class NotificationViewTests(LoggedInTestCase): create_worker(self.user) result = get_notifications(self.user) - self.assertEquals(0, result[0]) + self.assertEqual(0, result[0]) self.assertTrue(len(result[1]) > 0) def test_get_visits_without_appointments_count_2(self): @@ -147,7 +147,7 @@ class NotificationViewTests(LoggedInTestCase): visit.save() notification = get_visits_without_appointments_count(self.user) - self.assertEquals(original_notification.count, notification.count) + self.assertEqual(original_notification.count, notification.count) def test_get_visits_without_appointments_count_3(self): original_notification = get_visits_without_appointments_count(self.user) @@ -159,7 +159,7 @@ class NotificationViewTests(LoggedInTestCase): appointment.save() notification = get_visits_without_appointments_count(self.user) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) def test_get_unfinished_visits_order(self): subject = create_study_subject() @@ -177,7 +177,7 @@ class NotificationViewTests(LoggedInTestCase): visit.save() visits = get_unfinished_visits(self.user) - self.assertEquals(3, visits.count()) + self.assertEqual(3, visits.count()) # check sort order self.assertTrue(visits[0].datetime_begin < visits[1].datetime_begin) @@ -200,7 +200,7 @@ class NotificationViewTests(LoggedInTestCase): visit.save() visits = get_exceeded_visits(self.user) - self.assertEquals(1, visits.count()) + self.assertEqual(1, visits.count()) def test_get_exceeded_visits_with_scheduled_appointment(self): subject = create_study_subject() @@ -220,7 +220,7 @@ class NotificationViewTests(LoggedInTestCase): create_appointment(visit) visits = get_exceeded_visits(self.user) - self.assertEquals(0, visits.count()) + self.assertEqual(0, visits.count()) def test_get_approaching_visits_without_appointments_count(self): original_notification = get_approaching_visits_without_appointments_count(self.user) @@ -230,7 +230,7 @@ class NotificationViewTests(LoggedInTestCase): visit.save() notification = get_approaching_visits_without_appointments_count(self.user) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) def test_get_approaching_visits_without_appointments_count_2(self): original_notification = get_approaching_visits_without_appointments_count(self.user) @@ -241,7 +241,7 @@ class NotificationViewTests(LoggedInTestCase): create_appointment(visit) notification = get_approaching_visits_without_appointments_count(self.user) - self.assertEquals(original_notification.count, notification.count) + self.assertEqual(original_notification.count, notification.count) def test_get_approaching_visits_without_appointments_count_3(self): original_notification = get_approaching_visits_without_appointments_count(self.user) @@ -255,7 +255,7 @@ class NotificationViewTests(LoggedInTestCase): appointment.save() notification = get_approaching_visits_without_appointments_count(self.user) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) def test_get_approaching_visits_without_appointments_order(self): subject = create_study_subject() @@ -273,7 +273,7 @@ class NotificationViewTests(LoggedInTestCase): visit.save() visits = get_approaching_visits_without_appointments(self.user) - self.assertEquals(3, visits.count()) + self.assertEqual(3, visits.count()) # check sort order self.assertTrue(visits[0].datetime_begin < visits[1].datetime_begin) @@ -284,7 +284,7 @@ class NotificationViewTests(LoggedInTestCase): create_study_subject() notification = get_subject_with_no_visit_notifications_count(self.user) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) def test_get_subject_with_no_visit_notifications_count_with_new_voucher(self): original_notification = get_subject_with_no_visit_notifications_count(self.user) @@ -292,7 +292,7 @@ class NotificationViewTests(LoggedInTestCase): create_voucher(study_subject) notification = get_subject_with_no_visit_notifications_count(self.user) - self.assertEquals(original_notification.count, notification.count) + self.assertEqual(original_notification.count, notification.count) def test_get_subject_with_no_visit_notifications_count_with_used_voucher(self): original_notification = get_subject_with_no_visit_notifications_count(self.user) @@ -302,7 +302,7 @@ class NotificationViewTests(LoggedInTestCase): voucher.save() notification = get_subject_with_no_visit_notifications_count(self.user) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) def test_get_subject_with_no_visit_notifications_count_2(self): original_notification = get_subject_with_no_visit_notifications_count(self.user) @@ -313,7 +313,7 @@ class NotificationViewTests(LoggedInTestCase): visit.save() notification = get_subject_with_no_visit_notifications_count(self.user) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) def test_get_subject_with_no_visit_notifications_count_3(self): original_notification = get_subject_with_no_visit_notifications_count(self.user) @@ -322,7 +322,7 @@ class NotificationViewTests(LoggedInTestCase): create_visit(subject) notification = get_subject_with_no_visit_notifications_count(self.user) - self.assertEquals(original_notification.count, notification.count) + self.assertEqual(original_notification.count, notification.count) def test_get_subject_with_no_visit_notifications_count_4(self): original_notification = get_subject_with_no_visit_notifications_count(self.user) @@ -331,7 +331,7 @@ class NotificationViewTests(LoggedInTestCase): study_subject.subject.save() notification = get_subject_with_no_visit_notifications_count(self.user) - self.assertEquals(original_notification.count, notification.count) + self.assertEqual(original_notification.count, notification.count) def test_get_subject_with_no_visit_notifications_count_5(self): original_notification = get_subject_with_no_visit_notifications_count(self.user) @@ -340,7 +340,7 @@ class NotificationViewTests(LoggedInTestCase): subject.save() notification = get_subject_with_no_visit_notifications_count(self.user) - self.assertEquals(original_notification.count, notification.count) + self.assertEqual(original_notification.count, notification.count) def test_get_subject_with_no_visit_notifications_count_6(self): original_notification = get_subject_with_no_visit_notifications_count(self.user) @@ -349,7 +349,7 @@ class NotificationViewTests(LoggedInTestCase): subject.save() notification = get_subject_with_no_visit_notifications_count(self.user) - self.assertEquals(original_notification.count, notification.count) + self.assertEqual(original_notification.count, notification.count) def test_get_unfinished_appointments_count(self): original_notification = get_unfinished_appointments_count(self.user) @@ -361,7 +361,7 @@ class NotificationViewTests(LoggedInTestCase): appointment.save() notification = get_unfinished_appointments_count(self.user) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) def test_get_unfinished_appointments_count_for_general_appointments(self): appointment = create_appointment() @@ -371,7 +371,7 @@ class NotificationViewTests(LoggedInTestCase): appointment.save() notification = get_unfinished_appointments_count(self.user) - self.assertEquals(0, notification.count) + self.assertEqual(0, notification.count) def test_get_unfinished_appointments_count_2(self): original_notification = get_unfinished_appointments_count(self.user) @@ -383,7 +383,7 @@ class NotificationViewTests(LoggedInTestCase): appointment.save() notification = get_unfinished_appointments_count(self.user) - self.assertEquals(original_notification.count, notification.count) + self.assertEqual(original_notification.count, notification.count) def test_get_unfinished_appointments_order(self): subject = create_study_subject() @@ -400,7 +400,7 @@ class NotificationViewTests(LoggedInTestCase): appointment.save() appointments = get_unfinished_appointments(self.user) - self.assertEquals(3, appointments.count()) + self.assertEqual(3, appointments.count()) # check sort order self.assertTrue(appointments[0].datetime_when < appointments[1].datetime_when) @@ -413,7 +413,7 @@ class NotificationViewTests(LoggedInTestCase): create_study_subject() notification = get_subject_with_no_visit_notifications_count(self.user) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) def test_get_subject_with_no_visit_notifications_count_for_invalid_location(self): worker = create_worker() @@ -427,13 +427,13 @@ class NotificationViewTests(LoggedInTestCase): subject.save() notification = get_subject_with_no_visit_notifications_count(worker) - self.assertEquals(original_notification.count, notification.count) + self.assertEqual(original_notification.count, notification.count) worker.locations = Location.objects.filter(name="l1") worker.save() notification = get_subject_with_no_visit_notifications_count(worker) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) def test_get_approaching_visits_for_mail_contact_count(self): original_notification = get_approaching_visits_for_mail_contact_count(self.user) @@ -443,7 +443,7 @@ class NotificationViewTests(LoggedInTestCase): visit.save() notification = get_approaching_visits_for_mail_contact_count(self.user) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) def test_get_approaching_visits_for_mail_contact_count_2(self): original_notification = get_approaching_visits_for_mail_contact_count(self.user) @@ -454,7 +454,7 @@ class NotificationViewTests(LoggedInTestCase): create_appointment(visit) notification = get_approaching_visits_for_mail_contact_count(self.user) - self.assertEquals(original_notification.count, notification.count) + self.assertEqual(original_notification.count, notification.count) def test_get_approaching_visits_for_mail_contact_count_3(self): original_notification = get_approaching_visits_for_mail_contact_count(self.user) @@ -468,7 +468,7 @@ class NotificationViewTests(LoggedInTestCase): appointment.save() notification = get_approaching_visits_for_mail_contact_count(self.user) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) def test_get_approaching_visits_for_mail_contact_count_4(self): original_notification = get_approaching_visits_for_mail_contact_count(self.user) @@ -479,7 +479,7 @@ class NotificationViewTests(LoggedInTestCase): visit.save() notification = get_approaching_visits_for_mail_contact_count(self.user) - self.assertEquals(original_notification.count, notification.count) + self.assertEqual(original_notification.count, notification.count) def test_get_approaching_visits_for_mail_contact_order(self): subject = create_study_subject() @@ -497,7 +497,7 @@ class NotificationViewTests(LoggedInTestCase): visit.save() visits = get_approaching_visits_for_mail_contact(self.user) - self.assertEquals(3, visits.count()) + self.assertEqual(3, visits.count()) # check sort order self.assertTrue(visits[0].datetime_begin < visits[1].datetime_begin) @@ -511,10 +511,10 @@ class NotificationViewTests(LoggedInTestCase): subject.save() notification = get_subjects_with_reminder_count(self.user) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) notification = get_subject_with_no_visit_notifications_count(self.user) - self.assertEquals(original_without_visit_notification.count, notification.count) + self.assertEqual(original_without_visit_notification.count, notification.count) def test_get_subjects_with_reminder_count_2(self): original_without_visit_notification = get_subject_with_no_visit_notifications_count(self.user) @@ -524,10 +524,10 @@ class NotificationViewTests(LoggedInTestCase): subject.save() notification = get_subjects_with_reminder_count(self.user) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) notification = get_subject_with_no_visit_notifications_count(self.user) - self.assertEquals(original_without_visit_notification.count, notification.count) + self.assertEqual(original_without_visit_notification.count, notification.count) def test_get_subjects_with_reminder_count_3(self): original_without_visit_notification = get_subject_with_no_visit_notifications_count(self.user) @@ -537,10 +537,10 @@ class NotificationViewTests(LoggedInTestCase): subject.save() notification = get_subjects_with_reminder_count(self.user) - self.assertEquals(original_notification.count, notification.count) + self.assertEqual(original_notification.count, notification.count) notification = get_subject_with_no_visit_notifications_count(self.user) - self.assertEquals(original_without_visit_notification.count, notification.count) + self.assertEqual(original_without_visit_notification.count, notification.count) def test_get_filter_locations_for_invalid_user(self): locations = get_filter_locations(AnonymousUser()) @@ -560,13 +560,13 @@ class NotificationViewTests(LoggedInTestCase): voucher.save() notification = get_subject_voucher_expiry_notifications_count(self.user) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) voucher.expiry_date = get_today_midnight_date() + datetime.timedelta(days=365) voucher.save() notification = get_subject_voucher_expiry_notifications_count(self.user) - self.assertEquals(original_notification.count, notification.count) + self.assertEqual(original_notification.count, notification.count) def test_get_subjects_with_expiry_vouchers_and_contact_attempt(self): original_notification = get_subject_voucher_expiry_notifications_count(self.user) @@ -576,10 +576,10 @@ class NotificationViewTests(LoggedInTestCase): contact_attempt = create_contact_attempt(voucher.study_subject) notification = get_subject_voucher_expiry_notifications_count(self.user) - self.assertEquals(original_notification.count, notification.count) + self.assertEqual(original_notification.count, notification.count) contact_attempt.datetime_when = "2011-11-11" contact_attempt.save() notification = get_subject_voucher_expiry_notifications_count(self.user) - self.assertEquals(original_notification.count + 1, notification.count) + self.assertEqual(original_notification.count + 1, notification.count) diff --git a/smash/web/tests/view/test_study.py b/smash/web/tests/view/test_study.py index 40df2f29ea6df924021cb5f854c40e6731562b1d..e1965334f0a2cbdebd6cfeeb339927da3a317029 100644 --- a/smash/web/tests/view/test_study.py +++ b/smash/web/tests/view/test_study.py @@ -71,10 +71,10 @@ class StudyViewTests(LoggedInWithWorkerTestCase): prefix="columns") form_data = {} - for key, value in study_form.initial.items(): + for key, value in list(study_form.initial.items()): form_data['study-{}'.format(key)] = format_form_field(value) - for key, value in notifications_form.initial.items(): + for key, value in list(notifications_form.initial.items()): form_data['notifications-{}'.format(key)] = format_form_field(value) - for key, value in study_columns_form.initial.items(): + for key, value in list(study_columns_form.initial.items()): form_data['columns-{}'.format(key)] = format_form_field(value) return form_data diff --git a/smash/web/tests/view/test_subjects.py b/smash/web/tests/view/test_subjects.py index 71f0d3e773fa9cfba8d2cd6c5c3d5988c9bf6eaf..bfa50eaa035c54f7e606e6e393c96d7d2f235ab7 100644 --- a/smash/web/tests/view/test_subjects.py +++ b/smash/web/tests/view/test_subjects.py @@ -90,7 +90,7 @@ class SubjectsViewTests(LoggedInWithWorkerTestCase): updated_study_subject = StudySubject.objects.filter(id=study_subject.id)[0] self.assertTrue(updated_study_subject.endpoint_reached) visit_count = Visit.objects.filter(subject=study_subject).count() - self.assertEquals(1, visit_count) + self.assertEqual(1, visit_count) def test_save_subject_edit_when_resigned(self): study_subject = create_study_subject() @@ -111,7 +111,7 @@ class SubjectsViewTests(LoggedInWithWorkerTestCase): updated_study_subject = StudySubject.objects.filter(id=study_subject.id)[0] self.assertTrue(updated_study_subject.resigned) visit_count = Visit.objects.filter(subject=study_subject).count() - self.assertEquals(1, visit_count) + self.assertEqual(1, visit_count) def test_save_subject_edit(self): form_data = self.create_edit_form_data_for_study_subject() @@ -144,9 +144,9 @@ class SubjectsViewTests(LoggedInWithWorkerTestCase): form_study_subject = StudySubjectEditForm(instance=instance, prefix="study_subject") form_subject = SubjectEditForm(instance=instance.subject, prefix="subject") form_data = {} - for key, value in form_study_subject.initial.items(): + for key, value in list(form_study_subject.initial.items()): form_data['study_subject-{}'.format(key)] = format_form_field(value) - for key, value in form_subject.initial.items(): + for key, value in list(form_subject.initial.items()): form_data['subject-{}'.format(key)] = format_form_field(value) form_data["study_subject-referral_letter"] = SimpleUploadedFile("file.txt", b"file_content") return form_data @@ -155,9 +155,9 @@ class SubjectsViewTests(LoggedInWithWorkerTestCase): form_study_subject = StudySubjectAddForm(prefix="study_subject", user=self.user, study=self.study) form_subject = SubjectAddForm(prefix="subject") form_data = {} - for key, value in form_study_subject.initial.items(): + for key, value in list(form_study_subject.initial.items()): form_data['study_subject-{}'.format(key)] = format_form_field(value) - for key, value in form_subject.initial.items(): + for key, value in list(form_subject.initial.items()): form_data['subject-{}'.format(key)] = format_form_field(value) self.add_valid_form_data_for_subject_add(form_data) return form_data @@ -201,7 +201,7 @@ class SubjectsViewTests(LoggedInWithWorkerTestCase): self.assertEqual(response.status_code, 200) # check if file can be downloaded - url = reverse('web.views.uploaded_files') + "?file=" + unicode(subject.referral_letter) + url = reverse('web.views.uploaded_files') + "?file=" + str(subject.referral_letter) response = self.client.get(url) self.assertEqual(response.status_code, 200) diff --git a/smash/web/tests/view/test_visit.py b/smash/web/tests/view/test_visit.py index 549afd5e2f4de3fd72e56824310a49c55d26fe39..321d0a8440b8c653cd2a7fa9146a217e280815f1 100644 --- a/smash/web/tests/view/test_visit.py +++ b/smash/web/tests/view/test_visit.py @@ -42,7 +42,7 @@ class VisitViewTests(LoggedInTestCase): def create_visit_detail_form_data(visit): visit_detail_form = VisitDetailForm(instance=visit) form_data = {} - for key, value in visit_detail_form.initial.items(): + for key, value in list(visit_detail_form.initial.items()): form_data[key] = format_form_field(value) return form_data diff --git a/smash/web/tests/view/test_voucher.py b/smash/web/tests/view/test_voucher.py index 87390c8e8710a2727624cf4a1f368224617a2286..383bc0c909401014413607aa3ffcebc7fe51a35c 100644 --- a/smash/web/tests/view/test_voucher.py +++ b/smash/web/tests/view/test_voucher.py @@ -62,7 +62,7 @@ class VoucherTypeViewTests(LoggedInTestCase): "hours": 10, "voucher_type": voucher_type.id } - for key, value in visit_detail_form.initial.items(): + for key, value in list(visit_detail_form.initial.items()): form_data[key] = format_form_field(value) url = reverse('web.views.voucher_add') + '?study_subject_id=' + str(study_subject.id) @@ -79,7 +79,7 @@ class VoucherTypeViewTests(LoggedInTestCase): usage_partner.save() voucher_form = VoucherForm(instance=voucher) form_data = {} - for key, value in voucher_form.initial.items(): + for key, value in list(voucher_form.initial.items()): form_data[key] = format_form_field(value) form_data["usage_partner"] = usage_partner.id diff --git a/smash/web/tests/view/test_voucher_partner_session.py b/smash/web/tests/view/test_voucher_partner_session.py index fa666e13b0c6389c024b887a06d7113cf6b49631..1e547efb2d342e9e01d0db0b691dcff0461fc9d2 100644 --- a/smash/web/tests/view/test_voucher_partner_session.py +++ b/smash/web/tests/view/test_voucher_partner_session.py @@ -29,7 +29,7 @@ class VoucherTypeViewTests(LoggedInTestCase): "length": 50, "date": datetime.datetime.now(), } - for key, value in form.initial.items(): + for key, value in list(form.initial.items()): form_data[key] = format_form_field(value) url = reverse('web.views.voucher_partner_sessions_add', kwargs={'pk': voucher.id}) @@ -49,7 +49,7 @@ class VoucherTypeViewTests(LoggedInTestCase): "length": 60, "date": datetime.datetime.now(), } - for key, value in form.initial.items(): + for key, value in list(form.initial.items()): form_data[key] = format_form_field(value) url = reverse('web.views.voucher_partner_sessions_add', kwargs={'pk': voucher.id}) diff --git a/smash/web/tests/view/test_voucher_type_price.py b/smash/web/tests/view/test_voucher_type_price.py index 5032c40b46ed966049086ef792ba09061bbf78ba..f526eb34dcb0b27758cc71f24ccabeec3da1aadb 100644 --- a/smash/web/tests/view/test_voucher_type_price.py +++ b/smash/web/tests/view/test_voucher_type_price.py @@ -46,7 +46,7 @@ class VoucherTypePriceViewTests(LoggedInTestCase): voucher_type_price = create_voucher_type_price() form = VoucherTypePriceForm(instance=voucher_type_price) form_data = {} - for key, value in form.initial.items(): + for key, value in list(form.initial.items()): if value is not None: form_data['{}'.format(key)] = format_form_field(value) form_data['price'] = 90.50 diff --git a/smash/web/tests/view/test_worker.py b/smash/web/tests/view/test_worker.py index 06542ce84063bf39cd4840b63d2ca5b1e7028590..b0b78ca37f724d13b3043f2c0d75f899080fbefa 100644 --- a/smash/web/tests/view/test_worker.py +++ b/smash/web/tests/view/test_worker.py @@ -125,7 +125,7 @@ class WorkerViewTests(LoggedInTestCase): def get_form_data(worker=None): form = WorkerForm(instance=worker) form_data = {} - for key, value in form.initial.items(): + for key, value in list(form.initial.items()): form_data[key] = format_form_field(value) return form_data diff --git a/smash/web/utils.py b/smash/web/utils.py index 9e8ef001e14ee51891bde427a2c699df146ec727..eed9dbf7c8e8d9cff72e812877fc892306b8217d 100644 --- a/smash/web/utils.py +++ b/smash/web/utils.py @@ -45,6 +45,6 @@ def get_weekdays_in_period(fromdate, todate): if todate < fromdate: return set([]) day_generator = (fromdate + timedelta(day) - for day in xrange((todate - fromdate).days)) + for day in range((todate - fromdate).days)) weekdays = set([date.isoweekday() for date in day_generator]) return weekdays diff --git a/smash/web/views/__init__.py b/smash/web/views/__init__.py index 66c3b6339e4afecdf3332e273a6f03d4e1c43705..2b596bf5e83918150a2f0fd8bdc9ebcc1a7326c2 100644 --- a/smash/web/views/__init__.py +++ b/smash/web/views/__init__.py @@ -4,7 +4,7 @@ from django.shortcuts import redirect, render from django.views.generic.base import ContextMixin from web.models.constants import GLOBAL_STUDY_ID -from notifications import get_notifications +from .notifications import get_notifications from ..models import Worker, Study from web.decorators import PermissionDecorator @@ -48,7 +48,7 @@ def extend_context(params, request): if person is not None: role = person.role permissions = person.get_permissions(study) - person = unicode(person) + person = str(person) else: #use full name if available, username otherwise if len(request.user.get_full_name()) > 1: @@ -80,29 +80,29 @@ class WrappedView(ContextMixin): return super(WrappedView, self).dispatch(*args, **kwargs) -import auth -import appointment -import visit -import worker -import subject -import equipment -import equipment_and_rooms -import flying_teams -import kit -import mails -import statistics -import export -import contact_attempt -import configuration_item -import language -import voucher -import voucher_partner_session -import voucher_type -import voucher_type_price -import redcap -import rooms -import uploaded_files -import study -import password -import appointment_type -import provenance \ No newline at end of file +from . import auth +from . import appointment +from . import visit +from . import worker +from . import subject +from . import equipment +from . import equipment_and_rooms +from . import flying_teams +from . import kit +from . import mails +from . import statistics +from . import export +from . import contact_attempt +from . import configuration_item +from . import language +from . import voucher +from . import voucher_partner_session +from . import voucher_type +from . import voucher_type_price +from . import redcap +from . import rooms +from . import uploaded_files +from . import study +from . import password +from . import appointment_type +from . import provenance \ No newline at end of file diff --git a/smash/web/views/export.py b/smash/web/views/export.py index 9130b0fa15804a1dcbaf7bd983e3f5060c0ef3c3..82c1b68eb196a1f3fd8291f8c2ae2e54ee3de559 100644 --- a/smash/web/views/export.py +++ b/smash/web/views/export.py @@ -4,7 +4,7 @@ import csv import django_excel as excel from django.http import HttpResponse -from notifications import get_today_midnight_date +from .notifications import get_today_midnight_date from web.decorators import PermissionDecorator from . import e500_error, wrap_response from ..models import Subject, StudySubject, Appointment, ConfigurationItem @@ -28,7 +28,7 @@ def export_to_csv(request, data_type="subjects"): data = get_appointments_as_array(selected_fields=selected_fields) else: return e500_error(request) - writer = csv.writer(response, quotechar=str(u'"'), quoting=csv.QUOTE_ALL) + writer = csv.writer(response, quotechar=str('"'), quoting=csv.QUOTE_ALL) for row in data: writer.writerow([s.encode("utf-8") for s in row]) @@ -54,7 +54,7 @@ def export_to_excel(request, data_type="subjects"): class CustomField: def __init__(self, dictionary): - for k, v in dictionary.items(): + for k, v in list(dictionary.items()): setattr(self, k, v) @@ -123,7 +123,7 @@ def get_subjects_as_array(selected_fields=None): subjects = StudySubject.objects.order_by('-subject__last_name') for subject in subjects: row = subject_to_row_for_fields(subject, subject_fields) - result.append([unicode(s).replace("\n", ";").replace("\r", ";") for s in row]) + result.append([str(s).replace("\n", ";").replace("\r", ";") for s in row]) return result @@ -202,7 +202,7 @@ def get_appointments_as_array(selected_fields=None): # avoid last comma in the list of appointment types type_string = ','.join([appointment_type.code for appointment_type in appointment.appointment_types.all()]) row.append(type_string) - result.append([unicode(s).replace("\n", ";").replace("\r", ";") for s in row]) + result.append([str(s).replace("\n", ";").replace("\r", ";") for s in row]) return result diff --git a/smash/web/views/kit.py b/smash/web/views/kit.py index 374285be96003b08b48a4c330701e03a362ae330..280b1769ec2c8c96657e0efde571d4771cc39764 100644 --- a/smash/web/views/kit.py +++ b/smash/web/views/kit.py @@ -12,7 +12,7 @@ from django.utils.dateparse import parse_datetime from django_cron import CronJobBase, Schedule from django_cron.models import CronJobLog -from notifications import get_filter_locations, get_today_midnight_date +from .notifications import get_filter_locations, get_today_midnight_date from web.decorators import PermissionDecorator from web.models import ConfigurationItem, Language, Worker, Study from web.models.constants import KIT_RECIPIENT_EMAIL_CONFIGURATION_TYPE, KIT_DAILY_EMAIL_DAYS_PERIOD_TYPE, \ @@ -38,11 +38,11 @@ def get_kit_requests(user, start_date=None, end_date=None): else: if isinstance(start_date, str): start_date = parse_datetime(start_date) - if isinstance(start_date, unicode): + if isinstance(start_date, str): start_date = datetime.datetime.strptime(start_date, '%Y-%m-%d') if (end_date is not None) and (isinstance(end_date, str)): end_date = parse_datetime(end_date) - if (end_date is not None) and (isinstance(end_date, unicode)): + if (end_date is not None) and (isinstance(end_date, str)): end_date = datetime.datetime.strptime(end_date, '%Y-%m-%d') appointment_types = AppointmentType.objects.filter( @@ -124,12 +124,12 @@ def create_detailed_email_content(data, title): if item.disposable: email_body += item.name + ", " email_body += "</td>" - location = unicode(appointment.location) + location = str(appointment.location) if appointment.flying_team is not None: - location += " (" + unicode(appointment.flying_team) + ")" + location += " (" + str(appointment.flying_team) + ")" email_body += "<td style='" + cell_style + "'>" + location + "</td>" email_body += "<td style='" + cell_style + "'>" + \ - unicode(appointment.worker_assigned) + "</td>" + str(appointment.worker_assigned) + "</td>" email_body += "</tr>" email_body += "</tbody></table>" return email_body @@ -148,9 +148,9 @@ def create_statistic_email_content(data, title): for appointment in data["appointments"]: appointment_date = appointment.datetime_when.strftime(time_format) - location = unicode(appointment.location) + location = str(appointment.location) if appointment.flying_team is not None: - location += " (" + unicode(appointment.flying_team) + ")" + location += " (" + str(appointment.flying_team) + ")" simple_location = location.split(",")[0] if location_summary.get(simple_location) is None: location_summary[simple_location] = 0 diff --git a/smash/web/views/mails.py b/smash/web/views/mails.py index 7b49409c99a1f1fafb6c4600bf16fbd9af6897d2..a33842169622a00224c5feac02b6f3d91967f237 100644 --- a/smash/web/views/mails.py +++ b/smash/web/views/mails.py @@ -1,5 +1,5 @@ # coding=utf-8 -import StringIO +import io from wsgiref.util import FileWrapper from django.contrib import messages @@ -103,7 +103,7 @@ class MailTemplatesDeleteView(DeleteView, WrappedView): def generate(request, mail_template_id, instance_id): mail_template = get_object_or_404(MailTemplate, id=mail_template_id) instance = get_object_or_404(CONTEXT_TYPES_MAPPING[mail_template.context], id=instance_id) - stream = StringIO.StringIO() + stream = io.StringIO() stream = mail_template.apply(instance, request.user, stream) file_size = stream.tell() stream.seek(0) @@ -121,12 +121,12 @@ def generate_for_vouchers(request): vouchers.append(Voucher.objects.get(pk=int(voucher_id))) templates = MailTemplate.get_voucher_mail_templates([])[0] - output_stream = StringIO.StringIO() + output_stream = io.StringIO() inputs = [] for template in templates: for voucher in vouchers: - input_stream = StringIO.StringIO() + input_stream = io.StringIO() input_stream = template.apply(voucher, request.user, input_stream) input_stream.seek(0) inputs.append(input_stream) diff --git a/smash/web/views/redcap.py b/smash/web/views/redcap.py index 60e57dd8571577b308fcec00bfcd32c2d6a90da9..09156c4fd4fe3043f42f418a66400d439fb9743e 100644 --- a/smash/web/views/redcap.py +++ b/smash/web/views/redcap.py @@ -2,7 +2,7 @@ from django.contrib import messages -from notifications import get_missing_redcap_subjects, get_inconsistent_redcap_subjects +from .notifications import get_missing_redcap_subjects, get_inconsistent_redcap_subjects from . import wrap_response from ..redcap_connector import RedcapConnector diff --git a/smash/web/views/subject.py b/smash/web/views/subject.py index 5601e99b7e441774214da5b1de85b10bcd00fbc2..1583412ae89e5cb740e9a6fc3aab8581fdf71ee1 100644 --- a/smash/web/views/subject.py +++ b/smash/web/views/subject.py @@ -92,7 +92,7 @@ def subject_edit(request, id): modification_author = worker, previous_value = old_type, new_value = study_subject_form.cleaned_data['type'], - modification_description = u'Worker "{}" changed study subject "{}" from "{}" to "{}"'.format(worker, + modification_description = 'Worker "{}" changed study subject "{}" from "{}" to "{}"'.format(worker, study_subject.subject, old_value, new_value), modified_field = 'type', ) @@ -104,7 +104,7 @@ def subject_edit(request, id): modification_author = worker, previous_value = was_dead, new_value = True, - modification_description = u'Worker "{}" marks subject "{}" as dead'.format(worker, study_subject.subject), + modification_description = 'Worker "{}" marks subject "{}" as dead'.format(worker, study_subject.subject), modified_field = 'dead', ) study_subject.subject.mark_as_dead() @@ -116,7 +116,7 @@ def subject_edit(request, id): modification_author = worker, previous_value = was_resigned, new_value = True, - modification_description = u'Worker "{}" marks study subject "{}" as resigned from study "{}"'.format(worker, study_subject.nd_number, study_subject.study), + modification_description = 'Worker "{}" marks study subject "{}" as resigned from study "{}"'.format(worker, study_subject.nd_number, study_subject.study), modified_field = 'resigned', ) study_subject.mark_as_resigned() diff --git a/smash/web/views/virus_mail.py b/smash/web/views/virus_mail.py index 5901f419daea7a81c7607dd119abf4d9b7a3f384..193f371078890d1775c73a2734f0224ef4d61566 100644 --- a/smash/web/views/virus_mail.py +++ b/smash/web/views/virus_mail.py @@ -55,11 +55,11 @@ def get_subject_statistics(): def create_statistic_email_content(data, title): - email_body = u"<h1>" + title + "</h1>" + email_body = "<h1>" + title + "</h1>" - email_body += u'<b>Date: {}</b>'.format(datetime.datetime.now().strftime('%d.%m.%Y')) + "</br></br>" + email_body += '<b>Date: {}</b>'.format(datetime.datetime.now().strftime('%d.%m.%Y')) + "</br></br>" - email_body += u"In the past 24 hours " + str(data["total"]) + " donors were tested</br></br>" + email_body += "In the past 24 hours " + str(data["total"]) + " donors were tested</br></br>" email_body += """ <table style="border: 1px solid black; border-collapse: collapse;"> diff --git a/smash/web/views/visit.py b/smash/web/views/visit.py index c5c98c89d25c2a61cebbb0eb231f025030b8f508..d7d516cc616fe987d780c50d7d65bf34e6cda89d 100644 --- a/smash/web/views/visit.py +++ b/smash/web/views/visit.py @@ -3,7 +3,7 @@ import logging from django.shortcuts import get_object_or_404, redirect from django.contrib import messages -from notifications import waiting_for_appointment +from .notifications import waiting_for_appointment from web.models.study_visit_list import VISIT_LIST_GENERIC, VISIT_LIST_MISSING_APPOINTMENTS, \ VISIT_LIST_APPROACHING_WITHOUT_APPOINTMENTS, VISIT_LIST_APPROACHING_FOR_MAIL_CONTACT, VISIT_LIST_EXCEEDED_TIME, \ VISIT_LIST_UNFINISHED, VISIT_LIST_CHOICES @@ -99,7 +99,7 @@ def visit_mark(request, id, as_what): modification_author = worker, previous_value = visit.is_finished, new_value = True, - modification_description = u'Worker "{}" marked visit from "{}" as finished'.format(worker, visit.subject), + modification_description = 'Worker "{}" marked visit from "{}" as finished'.format(worker, visit.subject), modified_field = 'is_finished', ) visit.mark_as_finished() @@ -126,7 +126,7 @@ def visit_add(request, subject_id=-1): form = VisitAddForm(request.POST, request.FILES) args = {'form': form} if request.POST['subject'] != subject_id: - messages.add_message(request, messages.WARNING, u'The subject is invalid. Must be {}'.format(subject)) + messages.add_message(request, messages.WARNING, 'The subject is invalid. Must be {}'.format(subject)) return wrap_response(request, 'visits/add.html', args) if form.is_valid(): visit = form.save() diff --git a/smash/web/views/worker.py b/smash/web/views/worker.py index 801ffa61a693a08d544f40b20cfabf9ffbf1b36a..c0235e072680fb8d90fb8fefd4f160e1e66c90dd 100644 --- a/smash/web/views/worker.py +++ b/smash/web/views/worker.py @@ -87,7 +87,7 @@ def worker_availability_add(request, doctor_id): { 'form': form, 'doctor_id': doctor_id, - 'doctor_name': unicode(worker) + 'doctor_name': str(worker) }) @PermissionDecorator('change_worker', 'configuration') @@ -132,5 +132,5 @@ def worker_holiday_add(request, doctor_id): { 'form': form, 'doctor_id': doctor_id, - 'doctor_name': unicode(doctor) + 'doctor_name': str(doctor) }) diff --git a/smash/web/widgets/secure_file_widget.py b/smash/web/widgets/secure_file_widget.py index d26d799f1ea97c6414b865633183427ec973bba0..c930a764252277e7414274054bd469c038ef8d08 100644 --- a/smash/web/widgets/secure_file_widget.py +++ b/smash/web/widgets/secure_file_widget.py @@ -19,8 +19,8 @@ class SecuredFileWidget(forms.FileInput): def render(self, name, value, attrs=None): output = [] if value and hasattr(value, "url"): - url = reverse('web.views.uploaded_files') + '?file=' + unicode(value) - out = u'<a href="{}">{}</a><br />{} ' - output.append(out.format(url, _(u'Download'), _(u'Change:'))) + url = reverse('web.views.uploaded_files') + '?file=' + str(value) + out = '<a href="{}">{}</a><br />{} ' + output.append(out.format(url, _('Download'), _('Change:'))) output.append(super(SecuredFileWidget, self).render(name, value, attrs)) - return mark_safe(u''.join(output)) + return mark_safe(''.join(output))