Closed ashay-maheshwari closed 7 years ago
The better alternative is to write a trigger to change the value if is_active column to 1, before insert. Here is the trigger for the same -
DELIMITER //
CREATE TRIGGER auto_activate_user
BEFORE INSERT
ON auth_user FOR EACH ROW
BEGIN
SET NEW.is_active = 1;
END; //
DELIMITER ;
Tried and tested on open edx test machine. Its working.
Tried and tested on college-cloud. Working
A user on registration with edx is given a verification link on mentioned email address. This is okay where internet is available. On college cloud with no internet facility, activation link is never sent to the user and hence user is never activated and cannot login into his account after first log-out.
As a workaround to this problem, Sysadmin can activate users from django admin page of openedx. This is not scalable solution and we dont want admin to touch django settings of site.
In edxapp database, there is a table called , auth_user which is described as follows -
Setting is_active value to 1 will activate a user without clicking the verfication link.
Following mysql command can be used from shell to activate all users
mysql -u<username> -p<password> -e "update auth_user set is_active=1 where is_active=0;"
This can be executed from a script or crontab