Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mat_number identity protection #277

Open
physikerwelt opened this issue May 12, 2017 · 3 comments
Open

mat_number identity protection #277

physikerwelt opened this issue May 12, 2017 · 3 comments

Comments

@physikerwelt
Copy link
Contributor

For identity protection, the actual mat_number cannot be retrieved from shibboleth at my university. I appreciate that in principal. However, paktomat requires a unique mat_number of type integer. Our mat_number is of type string. After changing the data type, I could not run the migration script
./src/manage-local.py makemigrations which failed with the error below.
Thus, I had to

ALTER TABLE public.accounts_user
  ALTER COLUMN mat_number TYPE VARCHAR(100) USING mat_number :: VARCHAR(100);

.
However, since we are considering to use praktomat for a second course in the same semester this becomes inconvenient.

Error message:

Traceback (most recent call last):
  File "./src/manage-local.py", line 8, in <module>
    from django.core.cache import CacheKeyWarning
  File "/srv/praktomat/env/local/lib/python2.7/site-packages/django/core/cache/__init__.py", line 34, in <module>
    if DEFAULT_CACHE_ALIAS not in settings.CACHES:
  File "/srv/praktomat/env/local/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
  File "/srv/praktomat/env/local/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/srv/praktomat/env/local/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/srv/praktomat/src/settings/local.py", line 56, in <module>
    raise NotImplementedError("Autoconfig for PRAKTOMAT_ID %s not possible", PRAKTOMAT_ID)
NotImplementedError: ('Autoconfig for PRAKTOMAT_ID %s not possible', 'srv')
@physikerwelt
Copy link
Contributor Author

oups. I used the wrong script ./src/manage-devel.py makemigration works fine.

physikerwelt added a commit to physikerwelt/Praktomat that referenced this issue May 12, 2017
For identity protection, some universities do not
provide the actual mat_number via shibboleth.
However, a unique mat_number of type integer is required.

Using a string field is more flexible and should not
yield to significant performance drops, since the
mat_number is nominal data.

Close KITPraktomatTeam#277
physikerwelt added a commit to physikerwelt/Praktomat that referenced this issue May 12, 2017
For identity protection, some universities do not
provide the actual mat_number via shibboleth.
However, a unique mat_number of type integer is required.

Using a string field is more flexible and should not
yield to significant performance drops, since the
mat_number is nominal data.

Close KITPraktomatTeam#277
@ifrh
Copy link
Contributor

ifrh commented Mar 16, 2022

In reply to physikerwelt #277 (comment)

For identity protection, the actual mat_number cannot be retrieved from shibboleth at my university. I appreciate that in principal. However, paktomat requires a unique mat_number of type integer

Since the LDAP-Features are merged into master branch, there is a default configuration in settings/default.py not to create dummy values for mat_number, but you can activate that with corresponding change in settings/local.py.

# Set this to True to automatically set user.mat_number = user.id
d.DUMMY_MAT_NUMBERS = False

If activated dummy mat_numbers are stored automaticaly

def clean(self):
super(User, self).clean()
if settings.DUMMY_MAT_NUMBERS:
self.mat_number = self.id

Perhabs this issue can be closed?

@ifrh
Copy link
Contributor

ifrh commented May 5, 2022

@hannesbraun created the pullrequest #334 for not validating DUMMY_MAT_NUMBERS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants