import random
import json
import time
from registrationValidation import*


class User:
    def __init__(self, name, surname, username, password, user_id, authority, status):
        self.name = name
        self.surname = surname
        self.username = username
        self.password = password
        self.user_id = user_id
        self.authority = authority
        self.status = status


def id_creator():
    generated_id = random.randint(1000, 9999)

    with open("userDB.json") as user_file:
        data = json.load(user_file)

        for user_id in data["users"]:
            if user_id["user_id"] == generated_id:
                while True:
                    generated_id = random.randint(1000, 9999)
                    if user_id["user_id"] != generated_id:
                        break
    return generated_id


def registerUser():
    userId = id_creator()
    name = name_validation()
    surname = surname_validation()
    username = username_validation()
    password = password_validation()
    authority = "user"
    status = "active"

    user = User(name, surname, username, password, userId, authority, status)
    print("\nRegistration process has successfully finished!")
    print("Redirecting to main menu...\n\n")
    time.sleep(3)

    return user


32c8771d4bb14968e0ab0e93d4ffa6f4cfe8c7ca
<mask token>


class User:

    def __init__(self, name, surname, username, password, user_id,
        authority, status):
        self.name = name
        self.surname = surname
        self.username = username
        self.password = password
        self.user_id = user_id
        self.authority = authority
        self.status = status


<mask token>

<mask token>


class User:

    def __init__(self, name, surname, username, password, user_id,
        authority, status):
        self.name = name
        self.surname = surname
        self.username = username
        self.password = password
        self.user_id = user_id
        self.authority = authority
        self.status = status


<mask token>


def registerUser():
    userId = id_creator()
    name = name_validation()
    surname = surname_validation()
    username = username_validation()
    password = password_validation()
    authority = 'user'
    status = 'active'
    user = User(name, surname, username, password, userId, authority, status)
    print('\nRegistration process has successfully finished!')
    print('Redirecting to main menu...\n\n')
    time.sleep(3)
    return user

<mask token>


class User:

    def __init__(self, name, surname, username, password, user_id,
        authority, status):
        self.name = name
        self.surname = surname
        self.username = username
        self.password = password
        self.user_id = user_id
        self.authority = authority
        self.status = status


def id_creator():
    generated_id = random.randint(1000, 9999)
    with open('userDB.json') as user_file:
        data = json.load(user_file)
        for user_id in data['users']:
            if user_id['user_id'] == generated_id:
                while True:
                    generated_id = random.randint(1000, 9999)
                    if user_id['user_id'] != generated_id:
                        break
    return generated_id


def registerUser():
    userId = id_creator()
    name = name_validation()
    surname = surname_validation()
    username = username_validation()
    password = password_validation()
    authority = 'user'
    status = 'active'
    user = User(name, surname, username, password, userId, authority, status)
    print('\nRegistration process has successfully finished!')
    print('Redirecting to main menu...\n\n')
    time.sleep(3)
    return user

import random
import json
import time
from registrationValidation import *


class User:

    def __init__(self, name, surname, username, password, user_id,
        authority, status):
        self.name = name
        self.surname = surname
        self.username = username
        self.password = password
        self.user_id = user_id
        self.authority = authority
        self.status = status


def id_creator():
    generated_id = random.randint(1000, 9999)
    with open('userDB.json') as user_file:
        data = json.load(user_file)
        for user_id in data['users']:
            if user_id['user_id'] == generated_id:
                while True:
                    generated_id = random.randint(1000, 9999)
                    if user_id['user_id'] != generated_id:
                        break
    return generated_id


def registerUser():
    userId = id_creator()
    name = name_validation()
    surname = surname_validation()
    username = username_validation()
    password = password_validation()
    authority = 'user'
    status = 'active'
    user = User(name, surname, username, password, userId, authority, status)
    print('\nRegistration process has successfully finished!')
    print('Redirecting to main menu...\n\n')
    time.sleep(3)
    return user

import random
import json
import time
from registrationValidation import*


class User:
    def __init__(self, name, surname, username, password, user_id, authority, status):
        self.name = name
        self.surname = surname
        self.username = username
        self.password = password
        self.user_id = user_id
        self.authority = authority
        self.status = status


def id_creator():
    generated_id = random.randint(1000, 9999)

    with open("userDB.json") as user_file:
        data = json.load(user_file)

        for user_id in data["users"]:
            if user_id["user_id"] == generated_id:
                while True:
                    generated_id = random.randint(1000, 9999)
                    if user_id["user_id"] != generated_id:
                        break
    return generated_id


def registerUser():
    userId = id_creator()
    name = name_validation()
    surname = surname_validation()
    username = username_validation()
    password = password_validation()
    authority = "user"
    status = "active"

    user = User(name, surname, username, password, userId, authority, status)
    print("\nRegistration process has successfully finished!")
    print("Redirecting to main menu...\n\n")
    time.sleep(3)

    return user

